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

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

by jdporter (Paladin)
on Jan 20, 2010 at 16:40 UTC ( [id://818505]=note: print w/replies, xml ) Need Help??


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

Because the other part of the statement ($foo) is duplicated - if I have a long variable like $myhash{mykey}->{mykey2} instead of $foo it only gets uglier

Then try:

$_ = $bar // $_ for $myhash->{mykey}{mykey2};

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-20 03:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found