These, and others are all used uninitialized. That is what strict has been trying to tell you.my $max1; my $max2; my $min1; my $min2; my $i;
Would be better but if I see variable names like that ( $x1, $x2 ) then I think something is wrong with the program structure. In this case the author has not used subroutines to factor out duplicate code so he resorted to overlapping variable names and cluttered up the namespace.my ($max1, $max2, $min1, $min2, $i) = (0,0,0,0,0, );
open(FILE1,"fwd.stb"); should be: open(FILE1,"fwd.stb") or die "Can\'t open file\n";
The same errors are repeated later in the code because the same code is repeated. Use subroutines to replace repeated code. At least you won't have to fix every error twice.
for($i=0;$i<$len-1;$i++)This will skip the last element of the array. The conditional should be <= or a more perlish: for(0 .. scalar @x -1)
You have two variables $call and $count that are neither declared nor initialized. Strict has been trying to tell you that also.
In reply to Re: Prob with 'while' loop and subroutine calling
by starbolin
in thread Prob with 'while' loop and subroutine calling
by cool
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |