Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Check/set hash of hashes value

by kennethk (Abbot)
on Jun 24, 2013 at 16:29 UTC ( #1040452=note: print w/ replies, xml ) Need Help??


in reply to Check/set hash of hashes value

++davido and ++hdb. If you'd like to save yourself a little typing and are using 5.10 or better (probably), you could use Logical Defined Or Assignment Operators to produce what is cleaner and more obvious to me (YMMV):

foreach my $ip ( keys %subnets ) { $subnets{$ip}{comment} //= 'ALLOCATED'; }

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.


Comment on Re: Check/set hash of hashes value
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2015-07-04 06:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls