lightoverhead has asked for the wisdom of the Perl Monks concerning the following question:
I may ask a stupid question, but why the $ARGV[0] in while loop cannot be accessed?
I thought @ARGV is global variable and should be accessed anywhere, of course from within of while loop.
did I miss something?
print $ARGV[0],"\n"; #printed while(<>){ print "$ARGV[0]\n"; #cannot be printed }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: @ARGV in while loop
by BrowserUk (Patriarch) on Feb 14, 2014 at 17:38 UTC | |
by lightoverhead (Pilgrim) on Feb 14, 2014 at 17:59 UTC | |
by lightoverhead (Pilgrim) on Feb 14, 2014 at 18:39 UTC | |
|
Re: @ARGV in while loop
by Kenosis (Priest) on Feb 14, 2014 at 17:53 UTC | |
by lightoverhead (Pilgrim) on Feb 14, 2014 at 18:02 UTC |