Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: When warnings get in the way

by salva (Canon)
on Apr 24, 2005 at 12:45 UTC ( [id://450933]=note: print w/replies, xml ) Need Help??


in reply to When warnings get in the way

for a one time construction I would use
if (defined $foo and $foo eq 'true') {...}
but if I needed to code similar tests in several places I would go for:
sub is_true ($) { defined $_[0] and $_[0] eq 'true' } if (is_true $foo) {...} if (is_true $bar) {...}

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://450933]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2025-06-24 07:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.