ps: code is not testedif (scalar(@numbers) > 0) { # compare only when array has entries my $highest = $numbers[0]; # set startvalue foreach my $compNum (@numbers){ # compare all numbers in array $highest = $compNum if ($compNum > $highest); } } else { # nothing to compare }
In reply to Re: finding highest number
by Chief of Chaos
in thread finding highest number
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |