Re: POST blocks (like END, but in a sub or sub-like scope)

2001-02-08 Thread John Porter
David L. Nicol wrote: > > Do you agree that they shouldn't get tacked on until execution passes their > definition, unlike END blocks which get appended when they are parsed? Yes, absolutely; that is an important point. END blocks are different because there is only ever one activation record f

Re: POST blocks (like END, but in a sub or sub-like scope)

2001-02-08 Thread John Porter
Bart Lateur wrote: > 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

Re: POST blocks (like END, but in a sub or sub-like scope)

2001-02-08 Thread Bart Lateur
On Wed, 7 Feb 2001 23:41:32 +, Nicholas Clark wrote: >[on the other hand, I'll argue the other side that > >{ > my $flag > open FOO, " ... >} >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 s

Re: POST blocks (like END, but in a sub or sub-like scope)

2001-02-08 Thread Nicholas Clark
On Wed, Feb 07, 2001 at 10:59:00PM -0600, David L. Nicol wrote: > Nicholas Clark wrote: > > > on the other hand, I'll argue the other side that > > > > { > > my $flag > > open FOO, " > ... > > } > > post { > > close FOO if $flag; > > } > > > > is clearer because the tidy up doesn't visu

Re: POST blocks (like END, but in a sub or sub-like scope)

2001-02-07 Thread David L. Nicol
Nicholas Clark wrote: > on the other hand, I'll argue the other side that > > { > my $flag > open FOO, " ... > } > 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

Re: POST blocks (like END, but in a sub or sub-like scope)

2001-02-07 Thread Nicholas Clark
On Wed, Feb 07, 2001 at 05:15:41PM -0600, David L. Nicol wrote: > Nicholas Clark wrote: > > > > On Wed, Feb 07, 2001 at 04:30:24PM -0600, David L. Nicol wrote: > > > > > sub has_post_blocks{ > > > my $i = 3; > > > post { print "i ended up as $i"}; > > >

POST blocks (like END, but in a sub or sub-like scope)

2001-02-07 Thread David L. Nicol
Nicholas Clark wrote: > > On Wed, Feb 07, 2001 at 04:30:24PM -0600, David L. Nicol wrote: > > > sub has_post_blocks{ > > my $i = 3; > > post { print "i ended up as $i"}; > > my $arg1 = shift; $arg1 > 4 or die "arg1 ($arg1) too small"; > >