my @array = qw(1 6 2 8 3 4); my $max = $array[0]; for(@array){ $max = $_ if($_ > $max); } print $max;