Subject: | GetOptions() does not accept values like "5." as valid floating point |
Date: | Sat, 22 Aug 2020 05:37:36 -0700 |
To: | bug-Getopt-Long [...] rt.cpan.org |
From: | Dima Kogan <dima [...] secretsauce.net> |
Hi. Here's a demo program:
use Getopt::Long;
my %opt;
@ARGV=("cmd", "--opt", "5.");
GetOptions(\%opt, 'opt=f');
I'm telling the option parser to expect a --opt option with a
floating-point argument. This generally works. But when I give it "5."
as the argument string, it barfs:
Value "5." invalid for option opt (real number expected)
This is simply wrong. Strings like that are valid floats in perl and
everywhere else that I've seen.
Thanks.