my $hash_ref = {
one => { val => 1, name => 'one' },
three => { val => 3, name => 'three'},
two => { val => 2, name => 'two' },
};
I would like to sort $hash_ref
such that a foreach would order them by
$hash_ref->{$key}->{'val'}
one
two
three
Any suggestions?