note
klekker
I dont't understand the comment:
<code>
# Check this last to avoid parsing options as Places,
# and so don't override $opt_man verbose level
my @places = @ARGV;
pod2usage(-verbose => 1) && exit unless @places;
</code>
I evaluate "--help" and "--man" as "subs", like
<code>
GetOptions(
"help|?" => sub { pod2usage( -verbose => 1, -exitval => 0 ); },
"man" => sub { pod2usage( -verbose => 2, -exitval => 0 ); },
# ...
) or pod2usage( -verbose => 1, -exitval => 1);
</code>
<br />
The '-exitval' lets pod2usage exit the programm for you.
<br /><br />
The line "or pod2usage( -verbose => 1, -exitval => 1);" is now added to my code; until I read your article I never thought of checking GetOptions(). But it is a good idea! :)
155288
155288