On Wed, 7 Feb 2001 23:41:32 +0000, Nicholas Clark wrote: >[on the other hand, I'll argue the other side that > >{ > my $flag > open FOO, "<bar" ? $flag=1 : die "aargh $!"; > ... >} >post { > close FOO if $flag; >} > >is clearer because the tidy up doesn't visually get in the way of the flow >of what you're doing, and you can see what $flag is meant to be Perhaps. Then where will you put the equivalent PRE block? To make some sense WRT control flow, you should ut it upfront, BEFORE the declaration of the sub which it'll work on. But, from a language syntax point of view, that's nonsense. It's like putting the "else" before the "if". Yes, there ought to be PRE blocks as well. This is pure a syntax thing, the behaviour ought to be the same as so meticulously described by Damian Conway. The idea is inspired, not just by the existing BEGIN and END blocks syntax, but also by the fact that in 5.6.0, you can put a sub definition inside another sub. You can nest them. The effect is that nested sub is only visible from within the outer sub. That seems rather appropriate here. -- Bart.
- Re: assign to magic name-of-function variab... Peter Scott
- Re: assign to magic name-of-function variab... David L. Nicol
- Re: assign to magic name-of-function variab... John Porter
- Re: assign to magic name-of-function variab... Peter Scott
- Re: assign to magic name-of-function variab... David L. Nicol
- Re: assign to magic name-of-function variab... Nicholas Clark
- POST blocks (like END, but in a sub or sub-... David L. Nicol
- Re: POST blocks (like END, but in a sub or ... Nicholas Clark
- Re: POST blocks (like END, but in a sub or ... David L. Nicol
- Re: POST blocks (like END, but in a sub or ... Nicholas Clark
- Re: POST blocks (like END, but in a sub or ... Bart Lateur
- Re: POST blocks (like END, but in a sub or ... John Porter
- Re: POST blocks (like END, but in a sub or ... John Porter
- Re: assign to magic name-of-function variab... Glenn Linderman
- Re: assign to magic name-of-function variable i... Glenn Linderman
- Re: assign to magic name-of-function variable i... Johan Vromans
- Re: assign to magic name-of-function variable inste... Jarkko Hietaniemi
- Re: assign to magic name-of-function variable instead of... Bart Lateur
- Re: assign to magic name-of-function variable inste... Johan Vromans
- Re: assign to magic name-of-function variable i... John Porter
- Re: assign to magic name-of-function variable i... Ariel Scolnicov