On Sun, Mar 20, 2005 at 05:27:56PM -0700, Luke Palmer wrote: : I believe Perl 6 hasn't changed its policy on labels, so you should be : able to write that in Perl 6. But your behavior might be undefined. : It's weird to jump into the middle of a loop. We may only allow you to : jump outwards from your dynamic scope.
Perl 5's policy is to prohibit goto into anything that has to execute code to set up execution of the block, so you can't jump into a foreach loop, but you can jump into more basic sorts of loops. Perl 5 preallocates pad entries for loops within the outer sub's pad, so if you bypass a "my" you just get an undefined value but not a core dump. With the possibility of user-defined control structures, we may have to limit goto to blocks that we know we can inline, unless we define a goto interface for them. (On the other hand, we've been talking about multiple entry points for routines based on whether you've already done the argument type checking, and that's sort of the same idea. So it might just fall out naturally from that. I'm not holding my breath on it, though.) Larry