Do not initialize your $max_number:
my $max_number; #initialize a variable that keeps the maximum n +umber
so you can check for undef in your loop:
if(!defined($max_number) or $current_number > $max_number) + { $max_number = $current_number; #compare each time t +he number we have in the line with the max number }
In reply to Re: What is wrong in this code?
by hdb
in thread What is wrong in this code?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |