in reply to Ix::Hash with repeated keys

You might want to look at Tie::DxHash. I think this does what you want. Tie::IxHash only allows one value per key - Tie::DxHash allows duplicate keys although the documentation is not so good.

Untested code:
use strict; use Tie::DxHash; my %foo; tie %foo, 'Tie::DxHash'; %foo = qw ( one 1.2 one 1.6 one 1.9 two 2 three 3 ); my @keys = keys %foo; print "@keys\n"; # if @keys only has each key once, try this: foreach my $key (@keys) { print "$key, " foreach ($foo{$key}) }
Try it and see what happens - if it doesn't work, you might want to take another look at what you're doing and see if you can do whatever you're trying to do. Perhaps maintain a seperate count every time you add\delete a value.

Update: You don't really need a module to do this. Have a look at perldsc. You can create a type of hash that allows multiple values - a hash of arrays - i.e. each hash key points to an anonymous array. It would look like this:
%hash = ( one => [1.2, 1.6, 1.9], two => [2], three => [3]);
Look into perldsc anyway because I think this is best method.

Simon Flack ($code or die)
$,=reverse'"ro_';s,$,\$,;s,$,lc ref sub{},e;$,
=~y'_"' ';eval"die";print $_,lc substr$@,0,3;