in reply to Re^3: getopts and -?
in thread getopts and -?

Why package variables? my works as well, and you can even write:
GetOptions( d => \my $opt_d, h => \my $opt_h, l => \my $opt_l, ... ) or die "Failed to parse options";