# this works my $h={x=>5,y=>8}; while(my ($r,$s) = each(%{ $h })) { print($r); };