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

Re: [ID 19991115.012] Localization and goto()

Nick Ing-Simmons
November 16, 1999 09:47
Re: [ID 19991115.012] Localization and goto()
Message ID:
Tom Christiansen <> writes:
>>$a = 5;
>>sub a { print $a }
>>sub b {local $a = 9; goto &a}
>>This still prints 5... :-(
>And this is a problem exactly how?
>b()'s frame goes away.  

One could expect the frame to stay until the "goto" returned ;-)

>So its local view of $a 
>went away.  
>I do not find this behaviour astonishing.

Nick Ing-Simmons <>
Via, but not speaking for: Texas Instruments Ltd. Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About