develooper Front page | perl.perl5.porters | Postings from April 2013

Re: [perl #54044] perl -wle '%::=();//' crash

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
April 10, 2013 10:04
Subject:
Re: [perl #54044] perl -wle '%::=();//' crash
Message ID:
20130410100437.GX3729@plum.flirble.org
On Wed, Apr 10, 2013 at 06:48:23AM -0300, Brian Fraser wrote:
> Another objection, I don't think either of these should fail:
> 
> $ ./perl -e '%:: = %::'
> Attempt to clear the %main:: symbol table at -e line 1.
> 
> $ ./perl -e '%:: = map { $_ => $::{$_} } grep !/foo|bar/, keys %::;'
> Attempt to clear the %main:: symbol table at -e line 1.

Given how hash list assignment is implemented, it's hard to see how to
permit those to keep working whilst also adding a way to prevent
clearing %::

I can see that they are reduced test cases, but what's the real world
use case that they represent?

Nicholas Clark

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About