zapp_prefect has asked for the wisdom of the Perl Monks concerning the following question:
I means, if GetOptions can get the right options and find --help option ,it should show the help info output by error_info(). or if GetOptions failed to get the right options, some errors happend, it also should show the help info. but when I execute the script likes below:use Getopt::Long; my ( $timeout, $show_help ) = 30; unless ( GetOptions("timeout|t=i" => \$timeout, "help|h|?" => \$show_h +elp) && $show_help ) { error_info(); }
there's no output, so why?my.pl --help
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: why this not work? -- return value of GetOptions
by Discipulus (Canon) on Oct 10, 2016 at 07:26 UTC | |
by zapp_prefect (Initiate) on Oct 10, 2016 at 08:27 UTC | |
by Corion (Patriarch) on Oct 10, 2016 at 08:34 UTC | |
by zapp_prefect (Initiate) on Oct 10, 2016 at 09:08 UTC | |
|
Re: why this not work?
by Anonymous Monk on Oct 10, 2016 at 06:23 UTC |