Skip Menu |

This queue is for tickets about the version CPAN distribution.

Report information
The Basics
Id: 88572
Status: resolved
Priority: 0/
Queue: version

People
Owner: Nobody in particular
Requestors: 'spro^^*%*^6ut# [...] &$%*c
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.9905



Subject: UNIVERSAL::VERSION and argument checking
As far as I can tell, the UNIVERSAL::VERSION in the perl core has always been callable with no arguments, but reads past the end of the stack (seeing the argument to pp_entersub; usually the *UNIVERSAL::VERSION glob, but possibly a string used to call the sub). $ perl -le '*Foo = *UNIVERSAL::VERSION; $Foo::VERSION = 10; $_ = "Foo"; print $_->()' 10 $ perl -le '*Foo = *UNIVERSAL::VERSION; $Foo::VERSION = 10; $_ = \&Foo; print $_->()' Cannot find version of an unblessed reference at -e line 1. But version.pm’s UNIVERSAL::VERSION requires at least one argument: $ perl -Mblib -Mversion -le '*Foo = *UNIVERSAL::VERSION; $Foo::VERSION = 10; $_ = "Foo"; print $_->()' Usage: version::vxs::_VERSION(sv, ...) at -e line 1. I think the former behaviour is wrong, but the latter is less helpful than it could be. I would suggest: Usage: UNIVERSAL::VERSION(sv, ...) at -e line 1. I’m going to forward this to p5p, too.
Fixed in 0.9905