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
|