For Programmers: Free Programming Magazines  


Home > Archive > PerlTk > January 2005 > square symbol in Text









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author square symbol in Text
yusufdestina

2005-01-13, 4:00 pm

hi, I have a text widget wich show the output of another program.
I'm using open(FH, "prog -p -r |");
The problem is some square characters display in my text widget, I guess
they are returns.
how can i disable those char for displaying in my widget?
while(<FH> ){
print "$_\n";
}
close (FH);


Ala Qumsieh

2005-01-13, 4:00 pm

yusufdestina wrote:
> hi, I have a text widget wich show the output of another program.
> I'm using open(FH, "prog -p -r |");
> The problem is some square characters display in my text widget, I guess
> they are returns.


Probably true, especially if you are on Win32.

> how can i disable those char for displaying in my widget?
> while(<FH> ){


Try chomping here:

chomp;

> print "$_\n";
> }
> close (FH);


--Ala
yusufdestina

2005-01-13, 8:58 pm

I did that, did'nt solve the problem :(


Ala Qumsieh

2005-01-13, 8:58 pm

yusufdestina wrote:

> I did that, did'nt solve the problem :(


Hmm .. are you on Win32 or not?
Try the brute force approach:

tr/\r\n//d;

Does that help?
--Ala
yusufdestina

2005-01-13, 8:58 pm

yes I'm on Win32.. I'll try the pattern ..

yusufdestina

2005-01-13, 8:58 pm

$_=~tr/\r\n//d;
It's ok m8 it works tnx for ur help on this.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com