Is this the best way to sort these arrays or is there a more efficient way.
my @something = (1,2,3,4);
my @text = ("bbbb","aaaa","dddd","cccc ccc");
for (sort { $text[$a] cmp $text[$b] } 0..$#text) {
print "$text[$_]:$page[$_]:$something[$_]\n";
}This is only an example the arrays I want to sort each have 250 elements.
Thanks
Bob
http://totallyfreeads.com.au
Code:
my @page = (24,75,41,9); my @something = (1,2,3,4);
my @text = ("bbbb","aaaa","dddd","cccc ccc");
for (sort { $text[$a] cmp $text[$b] } 0..$#text) {
print "$text[$_]:$page[$_]:$something[$_]\n";
}
Thanks
Bob
http://totallyfreeads.com.au