*iter = (@ARGV || -t STDIN) ? sub { shift @ARGV } : sub { <STDIN> }; while (defined(my $in = iter() )) { }
> Thanks!
Your welcome. :)
renaming iter to input may be more self documenting.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Re^3: Getting data from either ARGV or STDIN
by LanX
in thread Getting data from either ARGV or STDIN
by sleet
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |