Quick Command Line Arg parsing
Date : October 11, 2004
To parse command line arguments passed to a script without using a module, parse @ARGV with the following:
foreach my $arg (@ARGV) { $a = 1, next if $arg eq '-a'; $b = 1, next if $arg eq '-b'; $c = 1, next if $arg eq '-c'; }
Note: This is good only for boolean (on/off) command line switches.
Tags:
Perl