Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: undef vs 0

by ehdonhon (Curate)
on Feb 06, 2003 at 11:30 UTC ( #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? | Other CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2022-05-27 01:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (94 votes). Check out past polls.

    Notices?