Gary Stainburn wrote:

>
> return barf("some message") if (some condition);
>
> combining the if/print and the return in one. This would mean that the return
> would have to return from 2 subs (barf and he caller).
>
> I don't know if this is possible,

Sure.  Just be kind to yourself, and have barf() return a meaningful value, such
as, in this case, an explicit undef or 0.  Have the outer sub return a true value
if the nauseous condition does not occur.  That way, the caller of the outer sub
can read a true return value if it doesn't barf.  Very useful for error-trapping.

Joseph



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to