Perl: Sorting an associative array

Hi,

When using sort on an associative array:

foreach $key (sort(keys(%opalfabet))){
$value = $opalfabet{$key};
$result .= $value;
}

How does it handle double values?
It seems to me that it removes them, is that true? If so, is there a way to get around this?

Double values? I think you mean "identical keys"? The nature of a hash (asso. array) is that all keys should be unique. As for values, identical values are allowed. The only workaround is to use another data structure instead of a hash, depending on your application.

Would you clarify what you are actually asking?

Yes i do mean that there are double values in the keys. It seems i will have to use different keys.

Thank you for your help.