in reply to Bare blocks forgetting lexical values
My vote is that in the same way that it is illegal to goto a label within a for loop (see perltrap, section: "Discontinuance, Deprecation, and BugFix traps" ), it should probably be illegal to goto the middle of a block.
Apart from the fact I can't see any real use for the construct, one way to deal with the anomoly would be to only permit goto's from code at the same lexical scope or deeper. That is to say, make the labels themselves have lexical scope just like a my'd variable. That would allow most of the useful uses of goto to continue to work, but would prevent the anomoly you describe.
Okay you lot, get your wings on the left, halos on the right. It's one size fits all, and "No!", you can't have a different color.
Pick up your cloud down the end and "Yes" if you get allocated a grey one they are a bit damp under foot, but someone has to get them.
Get used to the wings fast cos its an 8 hour day...unless the Govenor calls for a cyclone or hurricane, in which case 16 hour shifts are mandatory.
Just be grateful that you arrived just as the tornado season finished. Them buggers are real work.
|
|---|