##
$ perl scratch.pl
[...]
'server1' => {
'memory' => '1024',
'network' => '2200',
'cpu' => '30',
'disk' => '100'
},
[...]
$ perl scratch.pl
[...]
'server1' => {
'disk' => '1024',
'memory' => '2200',
'cpu' => '30',
'network' => '100'
}
[...]
####
my @system_attributes = qw(memory cpu disk network);
[...]
my $hashref = $nodemetrics{'server1'};
@$hashref{@system_attributes}=@data;