It is a little tedious, but in simple situations, you can simply build a parallel array. When you add something to the hash add it to the array, then use the array elements to retrieve values from the hash. Not, terribly elegant, but it works.
.....
while (....getting keys and values for the hash....)
{
$hash{key} = value;
push @keys,key;
}
foreach $key (@keys)
{
my $value = $hash{$key};
print "The next element is $value\n";
}
....
Obviously, this gets messy quickly if you are not dealing with a fairly simple situation.
HTH
keep the rudder amid ship and beware the odd typo