Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Answer: How to deal with undefined returned variables.

( #729121=categorized answer: print w/ replies, xml ) Need Help??

Q&A > subroutines > How to deal with undefined returned variables. 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 rifling through the Monastery: (5)
As of 2016-06-26 23:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (332 votes). Check out past polls.