# put keys in ascending asciibetical order my @aKeys = sort keys %hSomeHash; #put keys in descending asciibetical order @aKeys = sort { $b cmp $a } keys %hSomeHash; # @var{keys} is a hash slice # @var[number range] is an array slice @hSomeHash{@aKeys[0..4]}; #values for first 5 sorted keys @hSomeHash{@aKeys[5..9]}; #values for next 5 sorted keys # or to create a hash from the a subset of keys my %hash0_4 = map { $_ => $hSomeHash{$_} } @aKeys[0..4]; my %hash5_9 = map { $_ => $hSomeHash{$_} } @aKeys[5..9];