To scripts that need a "toggle" option. Example:my %ARGS = map {$_,1} @ARGV;
Testing it:
Another is:if($ARGS{foo}) { ... }
To simple-word options:my %ARGS = @ARGV;
perl script.pl expire 100 rebuild all
if($ARGS{rebuild} eq 'all') { ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Poor's man command line arguments
by rob_au (Abbot) on Nov 14, 2002 at 00:56 UTC | |
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 | |
|
Re: Poor's man command line arguments
by Mr. Muskrat (Canon) on Nov 14, 2002 at 00:25 UTC | |
|
Re: Poor's man command line arguments
by belg4mit (Prior) on Nov 14, 2002 at 02:07 UTC | |
by superpete (Beadle) on Nov 15, 2002 at 01:29 UTC |