in reply to Re: getting the highest value in a simpler way
in thread getting the highest value in a simpler way
Is that just as efficient as writing it this way?:my $x = 0; foreach $y (@lots_of_values){ $x = $y if $y > $x; } return $x;
The second way seems overly complicated in this case.my $x = 0; foreach $y (@lots_of_values){ $x = [ $x => $y ] -> [ $x <= $y ]; } return $x;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: getting the highest value in a simpler way
by BrowserUk (Patriarch) on Mar 17, 2011 at 21:18 UTC | |
by cLive ;-) (Prior) on Apr 18, 2011 at 12:48 UTC |