in reply to Re: Re: Getting last valid index from a particular list in a @LoL
in thread Getting last valid index from a particular list in a @LoL
#!/usr/bin/perl -wT use strict; my @aoa = ([1,2,3], [1,2,3,4,5], [1,2,3,4,5,6,7,8], [1,2,3,4], [1,2,3,4,5,6], ); my $i; my $index = (sort{$$b[1]-$$a[1]}map{[$i++,$#$_]}@aoa)[0]->[0]; print "\$aoa[$index] has the most elements\n"; =OUTPUT $aoa[2] has the most elements
-Blake
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re4: Getting last valid index from a particular list in a @LoL
by Hofmator (Curate) on Oct 17, 2001 at 15:59 UTC | |
by blakem (Monsignor) on Oct 17, 2001 at 21:35 UTC |