Skip Menu |

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

Report information
The Basics
Id: 11377
Status: resolved
Priority: 0/
Queue: Getopt-Long

People
Owner: Nobody in particular
Requestors: unkle_george [...] hotmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.34_02
Fixed in: (no value)



Subject: new range feature. CTL_AMAX, argcnt checking against -1
I love the new range functionality. I found a bug when using the undefined max range like in the example. I even found a fix. : ) GetOptions('rgbcolor=s{2,}' => \@color); The debugger shows $ma gets set to -1 ... cool. $argcnt++; last if $argcnt >= $ctl->[CTL_AMAX] && $ctl->[CTL_AMAX] != -1; undef($arg); When I step through to here, argcnt=1 and ctl->[CTL_AMAX] = -1. Show quoted text
1>-1 so it incorrectly aborted early. the && accounts for the possible -1 value.
Works. : ) Thanks again - Ryan