in reply to Specify Output of Keys in Hash
Maybe something like this:
>perl -wMstrict -le "my %hash = ( snake => { value => 1, order => 3, }, dog => { value => 2, order => 1, }, zebra => { value => 3, order => 2, }, ); my $out = join q{,}, sort { $hash{$a}{order} <=> $hash{$b}{order} } keys %hash ; ;; print qq{'$out'}; " 'dog,zebra,snake'
|
|---|