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

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

Thread Previous
From:
Brian Fraser
Date:
April 10, 2013 10:50
Subject:
Re: [perl #54044] perl -wle '%::=();//' crash
Message ID:
CA+nL+nY-bXUcy8DmFAZfxKoQrUqpKUX9Bbv3=mG=opt=2ZZUYA@mail.gmail.com
On Wed, Apr 10, 2013 at 7:04 AM, Nicholas Clark <nick@ccl4.org> wrote:

> 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?
>

Ah. Good question; None productive from me. I've only used them in joke
modules and when trying to make Perl crash. So that's a strike against that
objection.

Thread Previous


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