in reply to Re: Help display when executing the script
in thread Help display when executing the script

for a long time, Getopt::Std has supported an interface which doesn't require the use of package variables. You can pass in a reference to a hash and that hash will be populated with the options.

use Getopt::Std; my %opts; getopts('h', \%opts); help() if $opts{h};

I think that's a much nicer interface.

Also, I think your call to getopts uses the Getopt::Long interface, not the Getopt::Std one. Getopt::Std only supports single letter options.

--
<http://dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg