in reply to Why do I need a slash before my -- \my -- in getopts
The backslash is taking a reference to %opt (so getopts recieves a hashref which it populates). It's no different than
my %opt; @ARGV > 0 and getopts( 'a:', \%opt ) or die <<"USAGE";
or
my $opt = {}; @ARGV > 0 and getopts( 'a:', $opt ) or die <<"USAGE";
Just looks a little funy. And I usually use Getopt::Long, but that's just me (actually recently I use this more often, but that's not really going to help you . . . :).
|
|---|