Nathan Torkington wrote:
> John Porter writes:
> > Throw an exception in order to return a (0|'')-but-true value?
> 
> If you want to indicate that there was an error in the code, why not
> die()?  What am I missing?

I'm talking about the case where the require should "succeed" but
the return value is one which would evaluate to false, i.e.

        package Foo;
        initialize_myself();
        my $n = how_many_frobnitzes_loaded();
        $n;  # may be 0

and then

        my $n_frobs = require Foo;

But I admit this could be regarded as an edge case.

-- 
John Porter

Reply via email to