Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2016-10-24 23:05 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (310 votes). Check out past polls.