Skip Menu |

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

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

People
Owner: jv [...] cpan.org
Requestors: taerwin [...] tpg.com.au
Cc:
AdminCc:

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



Subject: Invalid option for blasti (number expected)
Perl Version 5.8.0 Arguments ending in i get treated as integers. i.e "blasti=s" => \$someVariable, $perl programName --blasti test Value "test" invalid for option blasti (number expected) This only occurs with variables that end in i.
From: Johan Vromans <jvromans [...] squirrel.nl>
Date: Mon, 20 Sep 2004 09:26:01 +0200
To: bug-Getopt-Long [...] rt.cpan.org
Subject: Re: [cpan #7707] Invalid option for blasti (number expected)
RT-Send-Cc:
I am unable to reproduce this. Could you please run the following program and send me its output: use Getopt::Long qw(:config debug); my $x; @ARGV = qw(--fooi xxx); GetOptions("fooi=s" => \$x); Thanks, Johan
I have tracked the problem down, it is not to do with variables ending with "i" but instead the options are not case sensitive. Below is the code and output I have used to reproduce the error ##CODE## #!/usr/bin/perl use Getopt::Long qw(:config debug); my ($x,$y); @ARGV = qw(--fooi xxx); GetOptions("fooi=s" => \$x, "FOOI=i" => \$y); ##OUTPUT## GetOpt::Long 2.32 ($Revision: 2.58 $) called from package "main". ARGV: (--fooi xxx) autoabbrev=1,bundling=0,getopt_compat=1,gnu_compat=0,order=1, ignorecase=1,passthrough=0,genprefix="(--|-|\+)". => link "fooi" to SCALAR(0x806057c) => link "FOOI" to SCALAR(0x8060588) => $opctl{fooi} = ARRAY(0x804cd2c) ["i","FOOI",O,$,"<undef>"] => arg "--fooi" => find "--fooi" => split "--"+"fooi" => 1 hits (fooi) with "fooi" out of 1 => found ["i","FOOI",O,$,"<undef>"] for "fooi" Value "xxx" invalid for option fooi (number expected)