Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Assignment to a value only if it is defined

by jettero (Monsignor)
on Jan 20, 2010 at 12:01 UTC ( #818431=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub mybar {
       my $t = bar();
    ...
        return $default unless defined $t;
        return $t;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://818431]
help
Chatterbox?
and dust plays in a shaft of sunlight...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2018-07-21 21:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (450 votes). Check out past polls.

    Notices?