my %hash = ( your => 1, data => 2, goes = 3, here => 4 ); my @sorted_keys = sort keys %hash; for( @sort_keys ) { print $hash{ $_ }; }