Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: undef vs 0

by ehdonhon (Curate)
on Feb 06, 2003 at 11:30 UTC ( [id://233108]=note: print w/replies, xml ) Need Help??


in reply to undef vs 0

In perl6, this will be easy:
my $value = getConfigValue( "use_foo" ) // 1;

In perl5, I think robartes has the right idea. Just to expand on it though, suppose you only want to call getConfigValue once for each value. You could do this:
my $value = defined($_ = getConfigValue( "use_foo" )) ? $_ : 1;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-24 02:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found