I'm asking if was anything in the settings to make it work differently.
Yes. If you don't want pass_through's behaviour, don't use pass_through.
use Getopt::Long (); our $opt_float; Getopt::Long::Configure('no_auto_abbrev'); Getopt::Long::GetOptions('float=f') or die("Bad args\n"); print("\$opt_float = ", defined($opt_float) ? $opt_float : "[undef]", +"\n"); print("\@ARGV = ", join(' ', @ARGV), "\n");
outputs
>perl 551404.pl -float 1.3 $opt_float = 1.3 @ARGV = >perl 551404.pl -float abc Value "abc" invalid for option float (real number expected) Bad args
In reply to Re^4: Issues w/ getOptions parsing options with pass_through enabled
by ikegami
in thread Issues w/ getOptions parsing options with pass_through enabled
by Brawny1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |