in reply to Poor's man command line arguments
For example, the following code will print bar! if the command line switch -foo is passed to the script:
#!/usr/bin/perl -s print "bar!\n" if ($foo);
This behaviour is documented in perlrun - For a truly evil use of this behaviour (and Perl in general) have a look at theDamian's selfGOL obfuscation :-)
perl -e 'print+unpack("N",pack("B32","00000000000000000000000111011111")),"\n"'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Poor's man command line arguments
by Louis_Wu (Chaplain) on Nov 14, 2002 at 01:26 UTC | |
by rob_au (Abbot) on Nov 14, 2002 at 01:35 UTC | |
by runrig (Abbot) on Nov 14, 2002 at 02:20 UTC |