in reply to while(<>) in perl 5.22
Has something happened?Nope.
Why is while (<>) not doing what it use to?It's doing the same thing as it has since at least 1999, when I started using Perl, and probably always has.
How do I get the old behavior<> reads either from files named as command-line arguments or from STDIN. It does not, and never has, returned the literal command-line arguments themselves.
If you want to access the literal command-line arguments, you can find them in the array @ARGV. e.g.:
$ perl -E 'for (@ARGV) { say $_ }' foo bar baz foo bar baz
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: while(<>) in perl 5.22
by haukex (Archbishop) on Nov 15, 2016 at 09:18 UTC |