in reply to getting args without clobbering @ARGV
I have used Getopt::Long for years, and it doesn't seem very "clunky and difficult to manage", but it could just be me. Here's how I'd do that:
use Getopt::Long; my $debug = 0; # Optional parameters (removed from @ARGV) GetOptions( 'debug' => \$debug, ); # Positional parameters (left in @ARGV) my ($infile) = @ARGV;
Update: replaced code ref with simple scalar ref to flag variable
Update: a few minor points:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: getting args without clobbering @ARGV
by bfdi533 (Friar) on May 11, 2006 at 20:13 UTC | |
by Xaositect (Friar) on May 11, 2006 at 20:40 UTC |