in reply to Sort 3X

The usual idiom for this is to use the short circuiting provided by ||.

@data_sorted_by_three_fields = sort { $a->[2] <=> $b->[2] || $a->[0] <=> $b->[0] || $a->[4] <=> $b->[4] } @data;
-sauoq
"My two cents aren't worth a dime.";

Replies are listed 'Best First'.
Re: Re: Sort 3X
by Anonymous Monk on Nov 23, 2002 at 03:26 UTC
    Thanks, I don't know why I didn't think of that

    Thanks again!