"be consistent" | |
PerlMonks |
Re: Array sort - kind of...by wog (Curate) |
on Feb 04, 2002 at 00:57 UTC ( [id://143135]=note: print w/replies, xml ) | Need Help?? |
@array = sort { $a->[2] <=> $b->[2] } @array But, you say you want to find the $i with the smallest z value. It's best to _not_ sort for that:
(update: Oops. Forgot the ->[2].) This should be signifigantly faster, especially when @array gets large...
In Section
Seekers of Perl Wisdom
|
|