<div dir="ltr"><div class="gmail_extra"><br></div><div class="gmail_extra">You can do it with a temporary variable *without* adding lines of code.<br><br>In fact, this way of doing it will reduce your lines of code =)<br><br>
</div><div class="gmail_extra"><br clear="all">sub max_length {<br>
my @list = @_;<br>
<br>
my $current_max;<br>
foreach my $item (@list) {<br></div><div class="gmail_extra"> next unless ( my $len = length($item) ) > $current_max; <br></div><div class="gmail_extra"> $current_max = $len;<br></div><div class="gmail_extra">
}<br>
return $current_max;<br>
}<br><br></div><div class="gmail_extra">Granted you need to have a little more brain power active to parse what is going on there.<br></div><div class="gmail_extra">-- <br>Kent <br>
</div></div>