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

Reply via email to