prints "d c a b"my @sortme = qw(a b c d); my @order = qw(d c e f); my %sortme; $sortme{$_}++ for @sortme; local $,=' '; print ((grep {$sortme{$_}-- } @order), grep { $sortme{$_} } @sortme);
-- stefp
In reply to Re: Sorting an array by another array
by stefp
in thread Sorting an array by another array
by TGI
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |