Think about Loose Coupling | |
PerlMonks |
Re^5: Not sure how to populate a hashby LanX (Saint) |
on Sep 24, 2014 at 13:35 UTC ( [id://1101795]=note: print w/replies, xml ) | Need Help?? |
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 ☆☆☆☆ :)
In Section
Seekers of Perl Wisdom
|
|