
jdhedden at cpan
Nov 28, 2007, 6:54 AM
Views: 126
Permalink
|
The following (attached): #!/usr/bin/perl use strict; use warnings; # Create a object from an anonymous scalar my $obj1 = \do{ my $scalar = 1; }; # Object ID = 1 bless($obj1, 'Foo'); # Put the object's ID into a hash my %ids; $ids{$$obj1} = undef; # Create a 2nd object my $obj2 = \do{ my $scalar; }; # Set the 2nd object IDs from the hash ($$obj2) = keys(%ids); delete($ids{$$obj2}); # Bless the 2nd object bless($obj2, 'Foo'); # Causes "Modification of a read-only value..." error # EOF Produces: Modification of a read-only value attempted at ./readonly_bug.pl line 23. Can this be fixed before 5.10.0 goes out?
|