$number_to_compare=..........; $max_numb=$number_to_compare; for($i=1; $i<=100; $i++) #### use List::Util qw(max); my @nums; for my $i (0 .. 100) { my $number_to_compare = ..........; push @nums, $number_to_compare; } my $max_numb = max(@nums);