in reply to Re: GetOptions option with value and no space
in thread GetOptions option with value and no space

I see that bundling is disabled as the default, thus the OP problem script should work as I see it.

update: Hm, when I use your configure 'bundling_values' the options should be case sensitive, but the original code has 'S=i' and when I execute:

$ ./tst.pl -S4

I get

Unknown option: S4 0

Replies are listed 'Best First'.
Re^3: GetOptions option with value and no space
by tangent (Parson) on Jul 12, 2015 at 13:18 UTC
    There does seem to be a problem with how the module handles case when "bundling_values" is turned on...

    When GetOptions is given 's=i' (lowercase) all works as expected:

    Getopt::Long::Configure ("bundling_values"); my $myOpt = 0; GetOptions('s=i'=> \$myOpt); print "bundling_values\n"; print "$myOpt\n\n"; $ test.pl -S1 Unknown option: S1 bundling_values 0 $ test.pl -s1 bundling_values 1
    When GetOptions is given 'S=i' (uppercase) works opposite to expected:
    Getopt::Long::Configure ("bundling_values"); my $myOpt = 0; GetOptions('S=i'=> \$myOpt); print "bundling_values\n"; print"$myOpt\n\n"; $ test.pl -S1 Unknown option: S1 bundling_values 0 $ test.pl -s1 bundling_values 1
    Workaround by adding 'ignorecase_always' option:
    Getopt::Long::Configure ("bundling_values", "ignorecase_always"); my $myOpt = 0; GetOptions('S=i'=> \$myOpt); print "bundling_values, ignorecase_always\n"; print "$myOpt\n\n"; $ test.pl -S1 bundling_values, ignorecase_always 1 $ test.pl -s1 bundling_values, ignorecase_always 1