karlgoethebier has asked for the wisdom of the Perl Monks concerning the following question:
Hi, please take a look at this little snippet:
use Data::Dumper; my $dir=$ARGV[0]; print Dumper(\@ARGV); print $dir; print shift; __END__ D:\tmp\Scripts>z1.pl foo $VAR1 = []; Use of uninitialized value $dir in print at D:\tmp\Scripte\z1.pl line +12. Use of uninitialized value in print at D:\tmp\Scripte\z1.pl line 14. D:\tmp\Scripts>perl z1.pl foo $VAR1 = [ 'foo' ]; foofoo D:\tmp\Scripte>
Big surprise!
It works on Linux, Mac and XP.
OS is Windows7 with ActivePerl.
Whats going on here?
Thank you and regards, Karl
«The Crux of the Biscuit is the Apostrophe»
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: What's wrong with @ARGV - or with me?
by choroba (Cardinal) on Jun 12, 2013 at 12:18 UTC | |
by karlgoethebier (Abbot) on Jun 12, 2013 at 12:30 UTC | |
by BrowserUk (Patriarch) on Jun 12, 2013 at 12:36 UTC | |
by blue_cowdawg (Monsignor) on Jun 12, 2013 at 13:02 UTC | |
by BrowserUk (Patriarch) on Jun 12, 2013 at 13:16 UTC | |
| |
by karlgoethebier (Abbot) on Jun 12, 2013 at 13:16 UTC | |
by BrowserUk (Patriarch) on Jun 12, 2013 at 13:21 UTC | |
| |
by fishmonger (Chaplain) on Jun 12, 2013 at 15:28 UTC | |
by karlgoethebier (Abbot) on Jun 12, 2013 at 15:31 UTC | |
Re: What's wrong with @ARGV - or with me?
by Utilitarian (Vicar) on Jun 12, 2013 at 12:40 UTC |
Back to
Seekers of Perl Wisdom