Edit: looks like i was way to slow again.my @a = qw(4444 22 1 22 333); my $shortest; my $min; for ( @a ) { my $l = length($_); if (not defined $min or $l<$min ) { $min=$l; $shortest=$_; } } print $shortest;
In reply to Re: Finding the Shortest Element in an Array
by holli
in thread Finding the Shortest Element in an Array
by awohld
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |