Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Answer: How to deal with undefined returned variables.

by Boldra (Deacon)
on Dec 09, 2008 at 10:23 UTC ( #729121=categorized answer: print w/replies, xml ) Need Help??

Q&A > subroutines > How to deal with undefined returned variables. - Answer contributed by Boldra

Russ mentioned that the // operator is in Perl 6, but in fact it is available in Perl 5.10:
use 5.010; $CONFIG{HASHTYPE} = $cfg->val("MISC","HASHTYPE") // 'sha1';
This only puts 'sha1' in your config value if your $cfg->val returns undef or nothing.

Definitely a valuable addition to the language.

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2016-09-27 03:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (494 votes). Check out past polls.