in reply to How to accept ARG from PIPE or STDIN?
This will, assuming $\ has not been messed with, loop for each line of input via:while (<>) { # do something with $_ }
and# cat myfile.txt | dosomething.pl
If you wanted to do:# dosomething.pl < myfile.txt
#dosomething.pl myfile.txt
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to accept ARG from PIPE or STDIN?
by ikegami (Patriarch) on Mar 17, 2005 at 03:02 UTC | |
by monkfan (Curate) on Mar 17, 2005 at 03:16 UTC | |
by ikegami (Patriarch) on Mar 17, 2005 at 04:34 UTC |