Subject: | UNIVERSAL's ->VERSION fails for module containing Readonly::Scalar our $VERSION =>1.2 |
We'd like to set the $VERSION string on our modules as Readonly::Scalar.
I find that calling mymodule->VERSION fails when I set its VERSION
readonly, but only if Readonly::XS is not installed (i.e. I get the
expected and desired functionality if Readonly::XS is installed - this
is why I've marked the bug as normal rather than important...).
Example one-liners:
dj3@sf-1-1-02:~$ PERL5LIB=~/perlABC/lib/perl5
/software/perl-5.8.8/bin/perl -wle 'use strict; use warnings; print
"Exporter::VERSION $Exporter::VERSION"; use Readonly; print
"Readonly::VERSION $Readonly::VERSION"; print "Readonly::XS::VERSION
".($Readonly::XS::VERSION||""); package foo; sub new{bless {},shift}
Readonly::Scalar our $VERSION => "1.2"; print foo->VERSION||"FALSE
version for class...."; print foo->new()->VERSION||"FALSE version for
object...."; while(my($k,$v)=each%INC){print "$k $v"}'
Exporter::VERSION 5.63
Readonly::VERSION 1.03
Readonly::XS::VERSION 1.05
1.2
1.2
XSLoader.pm
/nfs/users/nfs_d/dj3/perlABC/lib/perl5/x86_64-linux-thread-multi/XSLoader.pm
Readonly/XS.pm
/nfs/users/nfs_d/dj3/perlABC/lib/perl5/x86_64-linux-thread-multi/Readonly/XS.pm
warnings/register.pm /software/perl-5.8.8/lib/5.8.8/warnings/register.pm
Carp.pm /software/perl-5.8.8/lib/5.8.8/Carp.pm
vars.pm /software/perl-5.8.8/lib/5.8.8/vars.pm
Exporter.pm /nfs/users/nfs_d/dj3/perlABC/lib/perl5/Exporter.pm
strict.pm /software/perl-5.8.8/lib/5.8.8/strict.pm
Readonly.pm /nfs/users/nfs_d/dj3/perlABC/lib/perl5/Readonly.pm
warnings.pm /software/perl-5.8.8/lib/5.8.8/warnings.pm
#so working fine above...,
#now I disable Readonly::XS and...:
dj3@sf-1-1-02:~$ mv
/nfs/users/nfs_d/dj3/perlABC/lib/perl5/x86_64-linux-thread-multi/Readonly/XS.pm
/nfs/users/nfs_d/dj3/perlABC/lib/perl5/x86_64-linux-thread-multi/Readonly/XS.pm.tmp
dj3@sf-1-1-02:~$ PERL5LIB=~/perlABC/lib/perl5
/software/perl-5.8.8/bin/perl -wle 'use strict; use warnings; print
"Exporter::VERSION $Exporter::VERSION"; use Readonly; print
"Readonly::VERSION $Readonly::VERSION"; print "Readonly::XS::VERSION
".($Readonly::XS::VERSION||""); package foo; sub new{bless {},shift}
Readonly::Scalar our $VERSION => "1.2"; print foo->VERSION||"FALSE
version for class...."; print foo->new()->VERSION||"FALSE version for
object...."; while(my($k,$v)=each%INC){print "$k $v"}'
Exporter::VERSION 5.63
Readonly::VERSION 1.03
Readonly::XS::VERSION
FALSE version for class....
FALSE version for object....
warnings/register.pm /software/perl-5.8.8/lib/5.8.8/warnings/register.pm
Carp.pm /software/perl-5.8.8/lib/5.8.8/Carp.pm
warnings.pm /software/perl-5.8.8/lib/5.8.8/warnings.pm
vars.pm /software/perl-5.8.8/lib/5.8.8/vars.pm
Exporter.pm /nfs/users/nfs_d/dj3/perlABC/lib/perl5/Exporter.pm
strict.pm /software/perl-5.8.8/lib/5.8.8/strict.pm
Readonly.pm /nfs/users/nfs_d/dj3/perlABC/lib/perl5/Readonly.pm
I've tried perl 5.10.1 without Readonly::XS and get the same undef from
->VERSION
This is running on Debian V4 and 5.0.4 (with the above locally compiked
perl 5.8 and 5.10), and the Debian 5.8.8 perl.