in reply to Simple hash problem

Or, yet another way:
use strict; my %hash=("frog"=>"green", "camel"=>"camel_coloured", "flea"=>"who_kno +ws"); for (my $i=0,my @array=sort keys %hash; $i < 2 ; $i++) { print "Key $i: $array[$i]\n"; }
However, merlyn's answer shines in its KISSiness, so you're best off going with his solution.

CU
Robartes-

Update: Changed code snippet so it actually demonstrates the point made.