in reply to sorting multiple arrays on the criteria of one array
#!/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"; }
|
|---|