in reply to undef number?

I can think of 2 approaches:

1. Seed your $max_numb with your 1st $number_to_compare, then loop through one less:

$number_to_compare=..........; $max_numb=$number_to_compare; for($i=1; $i<=100; $i++)

2. push all your $number_to_compare into an array (you only have 101), then use List::Util::max:

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);