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

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

Thread Previous | Thread Next
From:
John Peacock
Date:
October 26, 2009 03:51
Subject:
Re: [perl #69452] UNIVERSAL::VERSION method docs fail to state acceptablevalues of $VERSION
Message ID:
4AE57F15.8030809@havurah-software.org
Richard Soderberg (via RT) wrote:
> 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.

Sorry I haven't responded to this until now; it isn't in the version.pm queue on
CPAN, so I forgot about it.

However, I cannot reproduce this with either 5.10.0 or 5.10.1 (nor with earlier
Perl's and version.pm explicitly loaded).  I get 3.210 for both (as I would have
expected).  Did you build this Perl yourself, or is this a package from your
distro (and if so, which one)?  Also, the script as included in the report
produces a syntax error:

	$ ./test
	syntax error at -e line 1, near "."
	Search pattern not terminated at -e line 1.

so what did you _really_ run?

John

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