Following code seems to work for me:
my @arr = map {[split /\s+/]} <DATA>; sub criteria { my $r = 0; $r ||= (($a->[$_]||0) <=> ($b->[$_]||0)) for 0..5; $r; } @arr = sort {criteria} @arr; print join "\n", map {join " ", @$_} @arr; __DATA__
This could be optimized to return from 0..5 loop earlier, and sub could be inlined, but let's do this another time.

Courage, the Cowardly Dog


In reply to Re: Complex Sort - using varying numbers of parameters by Courage
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":