in reply to Finding the Shortest Element in an Array
In English, this reads: "return the element among @things that minimizes the length function."my @things = qw[ hello superduper hi ]; my $shortest = argmin { length } @things;
Alternatively, you could loop through the array, manually keeping a watermark of the shortest string seen so far and its index.
blokhead
|
|---|