Here's mine, using the Schwartzian transform, recently learned :)
use strict; my @lA=reverse(1..9); my @lB=1..9; my @lC="a".."i"; sub trimult{ my ($l1,$l2,$l3)= @_; #list refs my @l; #temp list push @l,[$$l1[$_],$$l2[$_],$$l3[$_]] foreach (0..(scalar(@{$l1})-1)) +; #an array of each 3-uplet @l=map {$_->[0]} sort{$a->[1] <=> $b->[1]} map {[$_,$_->[0]]} @l; # S.Transform: sorting according to the first + elements (ie array l1) my $t=0; # I'm sure there is a perlvar that equals 0 ($| maybe?), bu +t this aint an obfu contest :) ($$l1[$t],$$l2[$t],$$l3[$t++])=@{$_} foreach(@l); # so @l is an array of array. So I can cast it's elements type as arr +ays @{likethis} and the assign them to my vars in a list context. } #end of procedure print "@lA, @lB, @lC\n"; #print &trimult (\@lA,\@lB,\@lC);#sort print "@lA, @lB, @lC\n"; #print and enjoy.


Hope you enjoy!

P!

In reply to Re: sorting multiple arrays on the criteria of one array by Pied
in thread sorting multiple arrays on the criteria of one array by Forsaken

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.