Script Output Woes (stdout?)

Hey everyone.

I have been trying a few filtering scripts with both SED and PERL. So far I have both of these versions working to reformat the incoming text stream (from stdin) into the corrent format (it looks good in the terminal), but I don't think that I am doing it right because the formatted text is not available to other applications/operations... but I can see it coming through in the terminal? Is this weird?

this is my setup:

% foo.app | perlFilter.pl

Works great - I can see it in the terminal, but

% foo.app | perlFilter > text

puts nothing into the file text!

% foo.app | perlFilter | nc 127.0.0.1 5001

Shows nothing going through to

nc -l -p 5001

Running nc in verbose mode shows that nothing is going through...

Here is my PERL script:

#!/usr/bin/perl

while (<>)  {
    $input = $_;
    chomp ($input);
    printf("%s;\n\r", $input);
    }

Do I need to explicitly write out to stdout or something?

I'm a newb.

Don't use Perl. Use awk, sed, or Ruby.

% foo.app | append_semicolon.awk >outfile

where the awk file contains

#!/usr/bin/nawk -f
{ printf "%s;\n", $0 }

or simply do

% foo.app | nawk '{ printf "%s;\n", $0 }' >outfile

Using Ruby:

% foo.app | ruby -lne 'print $_,";"' >outfile

Please do not start any more threads for this topic, use one of your existing ones.