in reply to getting args without clobbering @ARGV

An idiom I use a lot for quickie ad-hoc scripts with really simple option stuff:
# really simple: my $debug = ( @ARGV and $ARGV[0] eq '-d' ) ? shift : ''; # or, more in the style of getopt: my %opt; while ( @ARGV and $ARGV[0] =~ /^-([dv])$/ ) { $opt{$1} = 1; shift; }
But for anything more elaborate, I take the time to recheck the usage for Getopt::Std or Getopt::Long (can't seem to memorize it, but I've gotten better at locating my favorite parts of those man pages) -- it ends up quicker, cleaner and easier to maintain than not using one of those modules.