in reply to Sort Multidimensional Hash By Column

I'd never create a sub for that.
%h = ( pizza => { foo => 14, bar => 29 }, shoarma => { foo => 2, bar => 53 }, gyros => { foo => 10, bar => 35 }, ); @keys_sorted_foo_ascn = sort { $h{$a}{foo} <=> $h{$b}{foo} } keys %h; @keys_sorted_foo_desc = sort { $h{$b}{foo} <=> $h{$a}{foo} } keys %h; @keys_sorted_bar_ascn = sort { $h{$a}{bar} <=> $h{$b}{bar} } keys %h; @keys_sorted_bar_desc = sort { $h{$b}{bar} <=> $h{$a}{bar} } keys %h;

I find this a LOT easier than using a sub.

2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$