in reply to sorting hash by value when value is an array ref
@sorted_keys = sort { $foo{$a}[1] cmp $foo{$b}[1] } keys %foo; [download]