Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Assignment to a value only if it is defined

by voj (Acolyte)
on Jan 21, 2010 at 16:48 UTC ( [id://818760]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub setifdef { $_[0] = $_[1] if defined($_[1]) }
    setifdef $foo, $bar;
    
  2. or download this
    @list = @{$_} for grep defined, $listref_or_undef;
    @list = split(",",$_) for grep defined, $splitme_if_defined;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://818760]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-03-28 21:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found