in reply to Sorting arrays based on a single element

Please provide more context. You say you have an array, but you give the impression that it looks something like: my @array = (1,15,42); and you want to sort by the second number? That makes no sense (you can't sort a single value). However, if your array is really an array of arrays:
my @array = ([1,15,42], [5,2,36], [10,10,220]); # then you can use print "@$_\n" for sort { $a->[1] <=> $b->[1] } @array; # or @array = sort { $a->[1] <=> $b->[1] } @array;
And no need for shame. As my old Recording Industry prof used to say, "you are only one button push away". And sometimes it takes another pair of eyes to find that button.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)