On 5/11/05, Luke Palmer <[EMAIL PROTECTED]> wrote:
>     sub foo() {
>         fail;
>     }
> 
>     use fatal;
>     sub bar() {
>         foo();   # foo() throws exception
>     }
> 
>     no fatal;
>     sub baz() {
>         foo();   # foo() returns undef
>     }
> 
>     use fatal;
>     bar();  # propagates exception from foo()
>     baz();  # turns baz()'s (from foo()'s) undef into an exception
> 
>     no fatal;
>     bar();  # turns exception thrown from foo()'s into an undef
>     baz();  # returns the undef that it got from foo()

Oh, just to avoid further confusion: In the baz() called under fatal,
it will only turn undefs that were generated by "fail" calls into
exceptions.  Other sorts of undefs will be returned as ordinary
undefs.

Likewise, in the bar() called under no fatal, it will only turn
exceptions that were generated by "fail" calls into undefs.  Other
sorts of exceptions stay as exceptions and propagate outward.

Luke

Reply via email to