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

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