anadem has asked for the wisdom of the Perl Monks concerning the following question:
The GetOptions call prints "unknown option: blah" but badarg() isn't called. If the "<>" line is removed, then GetOptions still seems to swallow all the option, rather than leaving unmatched options in @ARGV.my $convert = 0; my $export = 0; my $exportfile = ""; ... GetOptions( "convert" => \$convert, "export" => \$export, "exportfile=s" => \$exportfile, "<>" => \&badarg, ); ... sub badarg { my $badparm = $_[0]; print"badarg $badparm\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: GetOptions non-option callback
by Tanktalus (Canon) on Feb 24, 2005 at 20:11 UTC | |
by anadem (Scribe) on Feb 24, 2005 at 20:31 UTC | |
|
Re: GetOptions non-option callback
by jimbojones (Friar) on Feb 24, 2005 at 20:30 UTC | |
by anadem (Scribe) on Feb 24, 2005 at 20:41 UTC | |
|
Re: GetOptions non-option callback
by jimbojones (Friar) on Feb 24, 2005 at 21:12 UTC |