in reply to hash first value

Sorted by key...
my $count = 0; for ( sort { $a cmp $b } keys %hash ) { print "$_ => $hash{$_}\n" if $count++ < 10; }

or by value...

my $count = 0; for ( sort { $hash{$a} cmp $hash{$b} } keys %hash ) { print "$_ => $hash{$_}\n" if $count++ < 10; }

Assuming you want ascending order. Swap $a and $b inside the sord block if you want descending. Change the 10 to the number of "first" values you want

If you had posted your code inside <code>...</code> tags, it would have been formated correctly.

Update: See also How do I sort a hash (optionally by value instead of key)? in perlfaq4

Update^2: Thanks to shmem for help with the link