in reply to sorting multiple arrays on the criteria of one array

The trick is to sort the indexes of the items in the first array into order based on the values in that array. Then you can use the sorted indexes to index each of your arrays.
#!/usr/bin/perl use warnings; use strict; my @data = (5, 2, 7, 0, 4); my @moredata = qw/five two seven zero four/; my @idx = sort {$data[$b] <=> $data[$a]} (0..$#data); for my $idx (@idx) { print "$data[$idx] $moredata[$idx]\n"; }