[pgh-pm] system() not displaying scalar text

Matthew T. Engel mengel at allegheny.edu
Tue Sep 4 11:04:53 PDT 2007


I think the problem is that I am trying to use the system function to echo
text to the terminal.  Something like:

 

#!/usr/bin/perl

while(<>)

{

        chomp;

        system("echo $_");

}

 

If I run the script via 

 

$ cat ascii_text_file | ./above_script.pl    Everything works fine where it
essentially cats the input file.  However, if I do a $ cat unicode_text_file
| ./above_script.pl. I get blank lines where the echo'd data should be.

 

I think the second file is Unicode because doing a $od -c Unicode_text file,
shows /0 in front of all the characters, and if I vi the same file it shows
^@ before every character.

 

I would like to be able to use Unicode and ascii text files
interchangeabley. please advice. Thank you very much in advance.

 

Matt

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/pgh-pm/attachments/20070904/e39a84a8/attachment.html 


More information about the pgh-pm mailing list