Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^5: Not sure how to populate a hash

by LanX (Saint)
on Sep 24, 2014 at 13:35 UTC ( [id://1101795]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Not sure how to populate a hash
in thread Not sure how to populate a hash

This creates a copy (NOT an alias i.e. writing to it won't change the original data)

 %server_properties = %{$nodemetrics{server1}}

Otherwise

$h_server1 = $nodemetrics{server1}

(like already shown) is the same hashref, which can be safely changed

$h_server1->{cpu}=100 or alternatively $$h_server1{cpu}=100

see perlref and perldsc for details!

Cheers Rolf

(addicted to the Perl Programming Language and ☆☆☆☆ :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-24 23:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found