You have I<no idea> how often that would have been useful. It's a great
exception safety mechanism... like C++'s "resource aquisition is
initialization" thingy, but without having to write a class for every
variable.
On Wed, 5 Jun 2002, David Whipp wrote:
> Page 13 tells use about C<let> decls. But it also says that the topic must
> be a regex. Whilst it explains that this isn't really a problem, I'm not
> sure that it justifies it. So perhaps someone can clarify why this
> (hypothetical) code in not a reasonable generalization:
>
>
> our $foo = 0;
>
> sub do_something
> {
> let $foo = $foo + 1;
> # stuff ...
> commit();
> }
>
> sub commit
> {
> fail if rand < 0.3;
> }
>
> for 1..10
> {
> do_something()
> CATCH { default {} }
> }
>
> print "$foo\n"; # expect a value of around 7
>
>
>
> Dave.
>