my @keys = sort { my @a = split '-', $tapes{$a}; my @b = split '-', $tapes{$b}; $a[-1] cmp $b[-1] } keys %tapes; foreach my $k (@keys) { print "$k $tapes{$k}\n"; }
However, I wouldn't put that code into production without understanding what it does. I urge you to ask questions, which I'll gladly answer.
Update:Fixed keys/values conflation.
In reply to Re: Crazy hash sorting issue.
by dragonchild
in thread Crazy hash sorting issue.
by rementis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |