use strict; my @array = (1, 5, 4, 10, 20, 2, 1, 3, 7); my $highest = $array[0]; foreach (@array) { $highest = $_ if $_ > $highest; } print $highest;