Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2021-04-13 07:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?