Package: perl
Version: 5.10.0-11

The attached program illustrates the problem. The output in all recent
versions up to 5.10.0-11 is below:

$./GO.pl
$VAR1 = {
          'l' => 'foo'
        };
$VAR1 = {
          'L' => 1
        };
$VAR1 = {
          'l' => 'foo'
        };
$VAR1 = {};

As no_ignore_case is turned on, and a -L option is not used, the 'L'
=> 1 from the second print statement is incorrect, and should be 'l'
=> 1, similarly, the fourth print statement should also produce 'l' =>
1
#!/usr/bin/perl

use warnings;
use strict;
use Data::Dumper;
use Getopt::Long qw(:config no_ignore_case pass_through);

my %options;
@ARGV = ( '-l', 'foo' );
my @args = (\%options, 'L|list-devices',
                       'l=s');
GetOptions (@args);
print Dumper(\%options);

undef %options;
@ARGV = ( '-l', 'foo' );
@args = (\%options, 'L|list-devices');
GetOptions (@args);
print Dumper(\%options);

undef %options;
@ARGV = ( '-l', 'foo' );
@args = (\%options, 'L',
                    'l=s');
GetOptions (@args);
print Dumper(\%options);

undef %options;
@ARGV = ( '-l', 'foo' );
@args = (\%options, 'L');
GetOptions (@args);
print Dumper(\%options);

Reply via email to