On Mon, 23 Jan 2017 06:04:36 GMT, jim.avera@gmail.com wrote: > > This is a bug report for perl from jim.avera@gmail.com, > generated with the help of perlbug 1.40 running under perl 5.22.1. > > ----------------------------------------------------------------- > Under "gnu_compat", if an optional-value option is defined, > for example > "color:s" => sub{...} > and the option is given without a value, then the action sub is > never called and the option is silently swallowed, i.e., lost. > > #!/usr/bin/perl > use strict; use warnings; > use Getopt::Long qw(GetOptions); > > @ARGV = ('--maybe'); > > warn "ORIGINAL ARGV=(@ARGV)\n"; > > Getopt::Long::Configure("gnu_compat"); > GetOptions( > "maybe:s" => sub{ die "maybe sub called" }, # never called > ); > > warn "FINAL ARGV=(@ARGV)\n"; # empty > > Getopt-Long is maintained upstream on CPAN. Please report this at https://rt.cpan.org/Dist/Display.html?Name=Getopt-Long. Thank you very much. -- James E Keenan (jkeenan@cpan.org) --- via perlbug: queue: perl5 status: new https://rt.perl.org/Ticket/Display.html?id=130626Thread Next