Skip Menu |

This queue is for tickets about the Attribute-Constant CPAN distribution.

Report information
The Basics
Id: 62021
Status: resolved
Priority: 0/
Queue: Attribute-Constant

People
Owner: Nobody in particular
Requestors: DAMI [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.02
Fixed in: (no value)



Subject: can't bless a Data::Locked structure, can't lock a blessed object
Under Perl 5.12.1, the following example in Data::Lock documentation doesn't work (generates an error "Modification of a read-only value attempted" when doing the bless) : If you want to make $o->{foo} immutable, Define Foo::new like: sub new { my $pkg = shift; dlock(my $self = { @_ }); bless $self, $pkg } Conversely, the following example in Attribute::Constant is wrong, because locking a blessed object is a no-op. dlock(my $p = Bar->new( 1, 2, 3 )); So in the end there is no way to lock a blessed object, neither before blessing it, nor after !
Fixed in 0.03. Thanks. Dan the Maintainer Thereof