use strict; use warnings; use 5.010; use Tie::IxHash; my %people; my $t = tie %people, 'Tie::IxHash'; %people = (first => 1, second => 2, third => 3); $people{another} = 5; $people{fourth} = 4; $t->SortByKey; # oder SortByValue while (my ($name, $nummer) = each %people) { print "$name->$nummer\n"; }