in reply to finding highest number
Which gives me 20. I'm sure there are prettier ways, but this seems to work.use strict; my @array = (1, 5, 4, 10, 20, 2, 1, 3, 7); my $highest = $array[0]; foreach (@array) { $highest = $_ if $_ > $highest; } print $highest;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: finding highest number
by diotalevi (Canon) on Dec 05, 2002 at 13:18 UTC | |
|
Re: Re: finding highest number
by Anonymous Monk on Dec 05, 2002 at 13:09 UTC | |
by petral (Curate) on Dec 05, 2002 at 17:11 UTC |