in reply to Re^3: Issues w/ getOptions parsing options with pass_through enabled
in thread Issues w/ getOptions parsing options with pass_through enabled

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

Replies are listed 'Best First'.
Re^5: Issues w/ getOptions parsing options with pass_through enabled
by Brawny1 (Initiate) on May 24, 2006 at 21:26 UTC
    I need pass_through on as this is a wrapper script. I wish to have some arguments to be passed through while others are type checked.