Front page | perl.fwp |
Postings from December 2001
Re: tri-state flags
Thread Previous
|
Thread Next
From:
Uri Guttman
Date:
December 5, 2001 23:57
Subject:
Re: tri-state flags
Message ID:
200112060756.CAA26922@home.sysarch.com.
>>>>> "BL" == Bart Lateur <bart.lateur@pandora.be> 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 ------ uri@stemsystems.com -------- 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
Thread Previous
|
Thread Next