Since noone has (yet) used grep....
sub shortest { my $shortest = length $_[0]; (grep { $shortest = length if($shortest > length); $shortest == length; }@_)[-1]); }
--MidLifeXis
In reply to Re: Finding the Shortest Element in an Array
by MidLifeXis
in thread Finding the Shortest Element in an Array
by awohld
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |