in reply to Sorting hash references

I think davido's approach is the cleanest/easiest. However, I would avoid the "sort" - since you are creating "@ordered_keys" anyway, why not store them in the right order as they are entered into the hash ?
my %hash; my @ordered_keys; while ( my $line = <DATA> ) { chomp $line; next unless $line; my ( $key, $value ) = split /\s*=\s*/, $line; $hash{$key} = $value; push @ordered_keys, $key; } # No need to sort - @ordered_keys is already in the right sequence... print "$_ = $hash{$_}\n" for @ordered_keys;
Of course, this begs the question - why use %hash at all - hopefully, you have a reason for that - need quick/random reference to the keys for an unstated reason.

Offense, like beauty, is in the eye of the beholder, and a fantasy.
By guaranteeing freedom of expression, the First Amendment also guarntees offense.