>>>>> "BL" == Bart Lateur <[EMAIL PROTECTED]> writes:


  BL> Yes. The values to test for are true, false (but not undef), and undef. 

i have an unusual variant of that in stem. many calls return either an
object or an error string. so the main boolean test is ref! and in some
cases undef is a legal return (usually generated by a plain return -
falling thru the end of a sub is not cool) meaning nothing was returned
but no error happened. so undef in this case is a positive result,
scalar string is a bad result and an object is the normal result. 

so here is the common test case:

        my $obj = somecall() ;
        return $obj unless ref $obj ;

error strings are always returned immediately and get propogated up the
call stack this way to be handled by the highest level call.

uri

ps. i have skipped the golf stuff since i am at LISA and i can't get the
spare time nor easy mail access to golf. looks like a lot of fun i am
skipping.


-- 
Uri Guttman  ------  [EMAIL PROTECTED]  -------- http://www.stemsystems.com
-- Stem is an Open Source Network Development Toolkit and Application Suite -
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org

Reply via email to