Skip Menu |

This queue is for tickets about the Getopt-Long CPAN distribution.

Report information
The Basics
Id: 90314
Status: rejected
Priority: 0/
Queue: Getopt-Long

People
Owner: jv [...] cpan.org
Requestors: kzwack [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: (no value)
Fixed in: (no value)



Subject: Change of behavior in Getopt::Long
Date: Tue, 12 Nov 2013 15:15:57 -0700
To: bug-Getopt-Long [...] rt.cpan.org
From: Kevin Zwack <kzwack [...] gmail.com>
Hello, Thank you for supporting Getopt::Long, I use it in all my program. I recently upgraded from a 2.3x version to 2.42 and noticed a slight change of behavior, which I think the following little program can demonstrate. #!/usr/bin/perl use Getopt::Long qw(:config pass_through); my $foo; GetOptions('foo=s' => \$foo); print join ", ", @ARGV; In one application, I use the "pass_through" option with several Perl modules in which each module processes its own options, and leaving the rest for the others. In the past, foo='' (that's two single quotes or null) would be slurped up by foo=s... Now in 2.42 foo=s only slurps up the option if it is given a non-null value such as foo='bar'. ./foo.pl -foo='' -bar Getopt::Long 2.42 called from package "main". argv: (-foo= -bar) autoabbrev=1,bundling=0,getopt_compat=1,gnu_compat=0,order=1, ignorecase=1,requested_version=0,passthrough=1,genprefix="(--|-|\+)",longprefix="(--)". => link "foo" to SCALAR(0x5703e4) => $opctl{foo} = ARRAY(0x65cecc) ["s","foo","<undef>",$,1,1] => arg "-foo=" => find "-foo=" => split "-"+"foo=" => option "foo", optarg = "" => 1 hits (foo) with "foo" out of 1 => found ["s","foo","<undef>",$,1,1] for "foo" => saving "-foo=" (not an option, may permute) => arg "-bar" => find "-bar" => split "-"+"bar" => 0 hits () with "bar" out of 1 => saving "-bar" (not an option, may permute) => restoring "-foo=" "-bar" -foo=, -bar I decided this is a bug in my application, and made a change to the effect 'foo:s' (change = to : ) and it now works correctly for me. If this is now the intended behavior of Getopt::Long, I'm okay with that and see the logic in it (an equals sign really means there must be a supplied string). Or perhaps it is an unexpected side-effect to some other change. I just wanted to mention it as an FYI. I don't know where to get older versions of Getopt::Long (I use the CPAN shell), so I cannot find exactly at which version the change may have occurred. Thanks, Kevin Zwack CYGWIN_NT-6.1 USDEND-KZwack 1.7.25(0.270/5/3) 2013-08-31 20:37 x86_64 Cygwin (Windows 7 x64 w/ Cygwin) pelr -v This is perl 5, version 14, subversion 2 (v5.14.2) built for MSWin32-x86-multi-thread (Strawberry Perl)
Subject: Re: [rt.cpan.org #90314] Change of behavior in Getopt::Long
Date: Wed, 13 Nov 2013 09:16:41 +0100
To: bug-Getopt-Long [...] rt.cpan.org
From: Johan Vromans <jvromans [...] squirrel.nl>
[Quoting Kevin Zwack via RT, on November 12 2013, 17:16, in "[rt.cpan.org #90314]"] Show quoted text
> I recently upgraded from a 2.3x version to 2.42 and noticed a slight > change of behavior, which I think the following little program can > demonstrate.
I'm really puzzled, since this behaviour did not change at least back to 2.27. What version did you upgrade from?
Subject: Re: [rt.cpan.org #90314] Change of behavior in Getopt::Long
Date: Wed, 13 Nov 2013 10:55:06 -0700
To: bug-Getopt-Long [...] rt.cpan.org
From: Kevin Zwack <kzwack [...] gmail.com>
As I mentioned in my email, I do not know what previous version we were using. If the behavior has been this way for some time, then this is a non-issue. I just thought i would point it out in the event it was something recent. Thanks & Regards, Kevin Zwack On Wed, Nov 13, 2013 at 1:16 AM, jvromans@squirrel.nl via RT < bug-Getopt-Long@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=90314 > > > [Quoting Kevin Zwack via RT, on November 12 2013, 17:16, in "[rt.cpan.org#90314]"]
> > I recently upgraded from a 2.3x version to 2.42 and noticed a slight > > change of behavior, which I think the following little program can > > demonstrate.
> > I'm really puzzled, since this behaviour did not change at least back > to 2.27. What version did you upgrade from? > > >