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: 20434
Status: resolved
Priority: 0/
Queue: Readonly

People
Owner: sanko [...] cpan.org
Requestors: Brad.Eisenberg [...] morganstanley.com
Cc:
AdminCc:

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



Subject: Fatal error if $_ is set to a Readonly value when "local $_;" is executed
Script dies with error Modification of a read-only value attempted at ... if $_ is set to a Readonly value when "local $_;" is executed. Example: Readonly::Array my @UPPERCASE => 'A' .. 'C'; localize_dollar( $_ ) for @UPPERCASE; sub localize_dollar { local $_; } Readonly-1.03 Test-Simple-0.62 This is perl, v5.8.4 built for i686-linux-thread-multi Linux coitlx05 2.4.21-32.0.1.ELhugemem #1 SMP Tue May 17 17:43:22 EDT 2005 i686
Subject: readonly.t
#!/ms/dist/perl5/bin/perl5.8 # # Test script to reproduce error: # Modification of a read-only value attempted at ... # # $_ is set to a Readonly value when "local $_;" is executed. # use strict; use warnings; use Test::More qw( no_plan ); use Readonly; my @lowercase = 'a' .. 'c'; Readonly::Array my @UPPERCASE => 'A' .. 'C'; Readonly my @MIXEDCASE => qw( X y Z ); localize_dollar( $_ ) for ( @lowercase, @UPPERCASE, @MIXEDCASE ); sub localize_dollar { my $value = shift; my $t = "test case '$value'"; diag( "Running $t" ); local $_; ok( 1, "Ran $t: OK" ); }
On Wed Jul 12 13:29:38 2006, guest wrote: Show quoted text
> Script dies with error > Modification of a read-only value attempted at ... > if $_ is set to a Readonly value when "local $_;" is executed. > > Example: > Readonly::Array my @UPPERCASE => 'A' .. 'C'; > localize_dollar( $_ ) for @UPPERCASE; > > sub localize_dollar { > local $_; > } > > Readonly-1.03 > Test-Simple-0.62 > This is perl, v5.8.4 built for i686-linux-thread-multi > Linux coitlx05 2.4.21-32.0.1.ELhugemem #1 SMP Tue May 17 17:43:22 EDT > 2005 i686
I cannot reproduce this using the test script provided on my v5.18.1 install of perl. It's probably safe to assume this is a bug related to older, pre-v5.8 builds. I'll mark this as resolved for now. -- Sanko Robinson sanko@cpan.org