Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Readonly CPAN distribution.

Report information
The Basics
Id: 57382
Status: resolved
Priority: 0/
Queue: Readonly

People
Owner: sanko [...] cpan.org
Requestors: david_j [...] users.sourceforge.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.03
Fixed in: (no value)



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.
On Tue May 11 13:44:19 2010, https://www.google.com/accounts/o8/id?id=AItOawlwrcEf5G3eMCpMZy55kRs16qNB3eRH1NM wrote: Show quoted text
> 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.
This is a tie-related bug in perl's core that I reported to p5p as RT#120102. The next major version of perl will include the fix. Thanks! -- Sanko Robinson sanko@cpan.org