Subject: | version->new("0.52_0") numifies incorrectly |
This is a bug report for perl from dagolden@cpan.org,
generated with the help of perlbug 1.39 running under perl 5.16.0.
-----------------------------------------------------------------
[Please describe your issue here]
As discussed on #toolchain:
Show quoted text
haarg> perl -mversion -le'print version->new("0.52_0")->numify' #
outputs 0._520
Show quoted textxdg> haarg, i think it's a bug because 0._520 warns if eval'd
("misplaced _ in number") and that shouldn't happen.
Show quoted textxdg> i'm not sure what would be right. possibly 0.520_000, but that
might compare funny
Show quoted textxdg> $ perl -mversion -we 'my $v1=version->new("0.52_0"); my
$v2=version->new("0.520_000"); say $v1==$v2' # true (whew)
Show quoted textxdg> $ perl -mversion=is_lax -we 'my $v1=version->new("0.52_0"); say
$v1->normal . (is_lax($v1->normal) ? " lax" : " not lax")'
Show quoted textxdg> v0_520.0 not lax
Show quoted textxdg> $ perl -mversion=is_lax -we 'my $v1=version->new("0.520_000"); say
$v1->normal . (is_lax($v1->normal) ? " lax" : " not lax")'
Show quoted textxdg> v0.520_0 lax
[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
category=core
severity=medium
---
Site configuration information for perl 5.16.0:
Configured by david at Fri Jul 20 11:04:40 PDT 2012.
Summary of my perl5 (revision 5 version 16 subversion 0) configuration:
Platform:
osname=linux, osvers=3.0.0-22-generic, archname=x86_64-linux
uname='linux icarus 3.0.0-22-generic #36-ubuntu smp tue jun 12
17:37:42 utc 2012 x86_64 x86_64 x86_64 gnulinux '
config_args='-de -Dprefix=/home/david/perl5/perlbrew/perls/perl-5.16.0'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2',
cppflags='-fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include'
ccversion='', gccversion='4.6.1', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
libpth=/usr/local/lib /lib/x86_64-linux-gnu /lib/../lib
/usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /usr/lib
libs=-lnsl -ldl -lm -lcrypt -lutil -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
libc=, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.13'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib
-fstack-protector'
Locally applied patches:
---
@INC for perl 5.16.0:
/home/david/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/x86_64-linux
/home/david/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0
/home/david/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0/x86_64-linux
/home/david/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0
.
---
Environment for perl 5.16.0:
HOME=/home/david
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_COLLATE=C
LC_CTYPE=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/home/david/perl5/perlbrew/bin:/home/david/perl5/perlbrew/perls/perl-5.16.0/bin:~/bin:~/git/utility-scripts:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/vagrant/bin:.
PERLBREW_BASHRC_VERSION=0.45
PERLBREW_HOME=/home/david/.perlbrew
PERLBREW_MANPATH=/home/david/perl5/perlbrew/perls/perl-5.16.0/man
PERLBREW_PATH=/home/david/perl5/perlbrew/bin:/home/david/perl5/perlbrew/perls/perl-5.16.0/bin
PERLBREW_PERL=perl-5.16.0
PERLBREW_ROOT=/home/david/perl5/perlbrew
PERLBREW_VERSION=0.45
PERL_BADLANG (unset)
PERL_EXTUTILS_AUTOINSTALL=--defaultdeps
SHELL=/bin/bash