develooper Front page | perl.perl5.porters | Postings from November 1999

Re: [ID 19991115.012] Localization and goto()

From:
Tom Christiansen
Date:
November 16, 1999 05:09
Subject:
Re: [ID 19991115.012] Localization and goto()
Message ID:
199911161308.GAA06261@jhereg.perl.com
>$a = 5;
>sub a { print $a }
>sub b {local $a = 9; goto &a}
>b;

>This still prints 5... :-(

And this is a problem exactly how?

b()'s frame goes away.  So its local view of $a 
went away.  

I do not find this behaviour astonishing.

--tom



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