in reply to Re: getopt::std to pass arguments to command line help
in thread getopt::std to pass arguments to command line help

hextor look at that good example by toolic and pay attention to the GetOptions ... or die; part.
This is very important because you dont want your program to execute with wrong or not accepted args.
Personally i ended using everytime yet another idiom, even more cautious:
use Getopt::Long; use Pod::Usage; # if you have documentation embedded is better unless (GetOptions( "option=s" => \$option ... )) { pod2usage(-verbose => 1,-exitval => 'NOEXIT'); # automatic u +sage printing (if you have an usage section in POD) &wait_for_input; # if the prog + was opend in a 'double click' fashion there is no time # to review e +rrors, if so you can just use something like: # sub wait_fo +r_input{ # print "\n +\nPress Return when ready\n"; # while (<S +TDIN>){last if $_ } # } exit; # now you can + exit or die with yet another error string }

HtH
L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.