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"; > my $j = 2; > post { print "j ended up as $j"}; > ... > }; > > might only print the message about i when arg1 is too small. This would > allow informational messages to be declared at the beginning, for instance. > > It would be implemented by pushing the post block onto the list of things > to do at scope exit, at run time. I quite like this idea. (I certainly like the ability to say "clean up this thing at the end of scope whatever exceptions may happen) But part of me feels it should be a POST block. Because it's behaving much like CHECK or END Nicholas Clark
- Re: assign to magic name-of-function variable instead... John Porter
- Re: assign to magic name-of-function variable instead... Tony Olekshy
- Re: assign to magic name-of-function variable instead... John Porter
- Re: assign to magic name-of-function variable instead... Peter Scott
- Re: assign to magic name-of-function variable instead... John Porter
- Re: assign to magic name-of-function variable instead... Peter Scott
- Re: assign to magic name-of-function variable instead... David L. Nicol
- Re: assign to magic name-of-function variable instead... John Porter
- Re: assign to magic name-of-function variable instead... Peter Scott
- Re: assign to magic name-of-function variable instead... David L. Nicol
- POST blocks (like END, but in a sub or sub-like scope... Nicholas Clark
- POST blocks (like END, but in a sub or sub-like scope... David L. Nicol
- Re: POST blocks (like END, but in a sub or sub-like s... Nicholas Clark
- Re: POST blocks (like END, but in a sub or sub-like s... David L. Nicol
- Re: POST blocks (like END, but in a sub or sub-like s... Nicholas Clark
- Re: POST blocks (like END, but in a sub or sub-like s... Bart Lateur
- Re: POST blocks (like END, but in a sub or sub-like s... John Porter
- Re: POST blocks (like END, but in a sub or sub-like s... John Porter
- Re: assign to magic name-of-function variable instead... Glenn Linderman
- Re: assign to magic name-of-function variable instead of &... Glenn Linderman
- Re: assign to magic name-of-function variable instead of &... Johan Vromans