in reply to How do I use the output of one perls script as the input of another on the commandline? like a pipeline
#!/usr/bin/perl while (<STDIN>) { chomp; print "$_ and two\n"; }
But it's better to use the following since <> is more flexible. It reads from STDIN unless file names are specified on the command line (in which case it reads the named files instead).
#!/usr/bin/perl while (<>) { chomp; print "$_ and two\n"; }
|
---|