in reply to Re: Re: Poor's man command line arguments
in thread Poor's man command line arguments
In short, it doesn't - The -s argument is meant for quick-and-nasty argument handling, the usage of these variable names causing explicit package name errors when employed with strict.
For example:
rob@budapest:/home/rob# cat test.perl #!/usr/bin/perl -s use strict; print "bar!\n" if ($foo); rob@budapest:/home/rob# ./test.perl -foo Variable "$foo" is not imported at ./test.perl line 5. Global symbol "$foo" requires explicit package name at ./test.perl lin +e 5. Execution of ./test.perl aborted due to compilation errors.
rob@budapest:/home/rob# cat test.perl #!/usr/bin/perl -s use strict; { no strict; print "bar!\n" if ($foo); } rob@budapest:/home/rob# ./test.perl -foo bar!
perl -e 'print+unpack("N",pack("B32","00000000000000000000000111100000")),"\n"'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Poor's man command line arguments
by runrig (Abbot) on Nov 14, 2002 at 02:20 UTC |