develooper Front page | perl.perl5.porters | Postings from September 2009

Re: [perl #69452] UNIVERSAL::VERSION method docs fail to state acceptablevalues of $VERSION

Thread Previous
From:
John Peacock
Date:
September 29, 2009 05:38
Subject:
Re: [perl #69452] UNIVERSAL::VERSION method docs fail to state acceptablevalues of $VERSION
Message ID:
4AC1FFB7.2020504@havurah-software.org
Abigail wrote:
> Running with warnings turned on reveals:
> 
>   $ perl -wE '$Foo::VERSION = "3.210pre"; say Foo -> VERSION'
>   Version string '3.210pre' contains invalid data; ignoring: 'pre' at -e line 1.
>   3.210
> 
> That's on both 5.10.0 and 5.10.1. It doesn't matter whether a 'use 5.010'
> is there or not (I get the same output if a replace -E with -le, and say
> with print). 5.8.8 doesn't give me the warning, and outputs '3.210pre'.

Yeah, that's because UNIVERSAL::VERSION in 5.10.x uses version.pm, and 
the 'pre' isn't numeric (hence must be ignored).  You'll get the same 
warning with 5.8.8 if you 'use version;' there.

None of this touches on the original bug, which I haven't had a second 
to take a look at...

John

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About