Or even (no sorting, no array index arithmetic):
Update: corrected typo 'arthimetic'.my %wanted = map { $_ => 1 } @unsorted; my @sorted = grep { $wanted{$_} } @preferred;
In reply to Re: Sorting based on a specific order
by Not_a_Number
in thread Sorting based on a specific order
by byteflow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |