develooper Front page | perl.perl6.language | Postings from September 2001

RE: What's up with %MY?

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
September 5, 2001 05:45
Subject:
RE: What's up with %MY?
Message ID:
200109051245.NAA10767@gizmo.fdgroup.co.uk
can I just clarify something about delete:

my $x = 1;
{
    my $x = 2;
    delete $MY::{'$x'};
    print $x;
    $mysub = sub {$x};
}

print $mysub->();

People seem agreed that print $x should do the equivalent of
	throw "lexical '$x' no longer in scope"
rather than printing 1, but what should print $mysub->() do?

I'd like it to also throw the same error, preferably at clone time.
Comments?
    
    


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