Your second example is not reading from STDIN, by the way. You probably meant this:@lines = <>;
$ perl thiscode.pl < SOMEFILE.txt
Update: Your first example, using the pipe, is reading from STDIN.. but the magic diamond <> works for both named arguments (files listed) and STDIN.
In reply to Re: How to accept ARG from PIPE or STDIN?
by moot
in thread How to accept ARG from PIPE or STDIN?
by monkfan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |