in reply to hashes with multiple keys
host1: vol1: 10g vol2: 20g vol3: 30g total:60h host2: vol4:30g vol5:20g vol2:20g total:70gYou should have data structure:
Iterate each host from $HOSTS (in sorted order) and iterate for each volume and get the values from other hash. and total them for capacity. </code>$VOLUMES = { vol1 => '10' , vol2 => '20', ... }; $HOSTS = { host1 => [qw(vol1 vol2 vol3), host2 => [qw(vol4 vol5 vol2)], ... };
|
---|