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 | Thread Next
From:
Steffen Mueller
Date:
September 29, 2009 03:12
Subject:
Re: [perl #69452] UNIVERSAL::VERSION method docs fail to state acceptablevalues of $VERSION
Message ID:
4AC1DD83.2060304@sneakemail.com
Hi Richard,

Richard Soderberg wrote:
> # New Ticket Created by  Richard Soderberg 
> # Please include the string:  [perl #69452]
> # in the subject line of all future correspondence about this issue. 
> # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=69452 >

> UNIVERSAL 1.05 says that:
> 
>   C<VERSION> will return the value of the variable C<$VERSION> in the
> package the object is blessed into.
> 
> However, this is not true for all values of $VERSION:
> 
>   #!/usr/bin/perl -E
>   $Foo::VERSION = "3.210"; say Foo->VERSION;
>   $Bar::VERSION = "3.210pre"; say Bar->VERSION;'
> 
>   __DATA__
>   3.210
>   0
> 
> The documentation has no mention of this behavior.

I tried to reproduce this on bleadperl, 5.10.1, and 5.10.0 and all three 
produce:
3.210
3.210

The only change is that I put a 'use 5.010;' in front of the two lines.

Now, whether this is the expected behaviour is another issue altogether. 
I'd expect it to behave the same as version.pm's 
"".version->new("3.210pre") and if someone in the know could confirm 
that, then documenting that it's passed through a version object may be 
worthwhile.

Best regards,
Steffen

Thread Previous | Thread Next


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