I saw a few GRTs, and a few awkward Schwartzian Transforms, so I thought I'd throw my own in:
my @sorted = map $_->[0], sort { for (1..1000) { return @$a <=> @$b if $_ > $#$a or $_ > $#$b; $_ and return $_ for $a->[$_] <=> $b->[$_]; } } map [$_, split /\s+/], @inputdata;
Presumes less than 1000 sort fields. Probably reasonable.

-- Randal L. Schwartz, Perl hacker


updated to reflect a few missing dollar signs and a brain confusion in a pre-caffiene state. {sigh}

In reply to •Re: Complex Sort - using varying numbers of parameters by merlyn
in thread Complex Sort - using varying numbers of parameters by George_Sherston

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":