in reply to Re: Sorting an array based on hash values
in thread Sorting an array based on hash values

If you want values in @to_be_ordered that are not in %order to be put at the end of the list, you might try something like this:
my @sorted = ((sort {$order{$a} <=> $order{$b}} grep {exists $order{$_}} @to_be_ordered), grep {not exists $order{$_}} @to_be_ordered);
Of course, this runs through @to_be_ordered twice, which is inefficient. So you might use two temporary arrays:
my (@exists, @not_exists); push @{exists $order{$_} ? \@exists : \@not_exists }, $_ for @to_be_or +dered; my @sorted = ((sort {$order{$a} <=> $order{$b}} @exists), @not_exists) +;

-- Mike

--
just,my${.02}