in reply to Confusion due to hash
You simply iterate through you existing hash and build up the new hash as you go, like so:
Using your sample data, that will give you something that looks like:foreach my $key (keys %hash) { $newhash{$hash{$key}} += $key; }
Does this help?%newhash = ( '1' => 40, '2' => 60 );
Cheers,
Darren :)
|
|---|