1nickt has asked for the wisdom of the Perl Monks concerning the following question:
Hi all, in perlrun under the documentation for the -a switch it states:
-a implicitly sets -n.
My testing seems to show this is not the case:
$ cat test.dat foo bar baz quux $ perl -wMstrict -M5.010 -ane 'say $F[0]' test.dat foo baz $ perl -wMstrict -M5.010 -ae 'say $F[0]' test.dat Variable "@F" is not imported at -e line 1. Global symbol "@F" requires explicit package name at -e line 1. Execution of -e aborted due to compilation errors.
Am I missing something?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perlrun: -a implicitly sets -n
by stevieb (Canon) on Jul 30, 2015 at 23:21 UTC | |
by 1nickt (Canon) on Jul 30, 2015 at 23:41 UTC | |
by stevieb (Canon) on Jul 30, 2015 at 23:55 UTC | |
by 1nickt (Canon) on Jul 31, 2015 at 00:20 UTC | |
by stevieb (Canon) on Jul 31, 2015 at 00:50 UTC | |
| |
|
Re: perlrun: -a implicitly sets -n
by BrowserUk (Patriarch) on Jul 30, 2015 at 23:27 UTC | |
by stevieb (Canon) on Jul 30, 2015 at 23:35 UTC |