We don't bite newbies here... much | |
PerlMonks |
Re: Capturing input from pipe?by ariels (Curate) |
on May 01, 2001 at 14:20 UTC ( [id://76913]=note: print w/replies, xml ) | Need Help?? |
If you want to read only the standard input, you can read the predefined filehandle STDIN.
For instance, to add line numbers to all lines coming from your pipe, you could do this:
But almost any program is more useful if it can read either STDIN or filenames supplied on the command line. So reading <> almost always makes more sense.
In Section
Seekers of Perl Wisdom
|
|