Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by jdporter (Canon)
on Jan 20, 2010 at 16:40 UTC ( #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
Node Status?
node history
Node Type: note [id://818505]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2021-04-11 10:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?