use Hash::Ordered; tie my %h1, 'Hash::Ordered', qw( title1 foo title2 bar title3 baz ); my @labels1 = keys %h1; my $h2 = Hash::Ordered->new(qw( title1 foo title2 bar title3 baz )); my @labels2 = $h2->keys;