my @array = qw(hello superduper hi); my $shortest = $array[0]; for( @array ) { $shortest = $_ if length $_ < length $shortest; }
In reply to Re: Finding the Shortest Element in an Array
by friedo
in thread Finding the Shortest Element in an Array
by awohld
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |