in reply to Re^2: Use of uninitialized value
in thread Use of uninitialized value

my $numerator; my $denominator; if ($indicator eq "SH") { $numerator = $last_element; } elsif ($indicator eq "SL"){ $denominator = $last_element; } else { ... } if (($numerator > 0) && ($denominator > 0)){ ...
The first time you execute the loop, $numerator or $denominator may get initialized, but never both. Therefore you get the error message Use of uninitialized value in numeric gt (>) at New_program.pl line 535.

Replies are listed 'Best First'.
Re^4: Use of uninitialized value
by Anonymous Monk on Nov 23, 2010 at 11:39 UTC
    I think you're right, but that would not explain his comments works here/ does not work here, the error would be the same at both points

      I wouldn't bother wasting your time trying to find an explanation for their comments, they've clearly spent no time debugging the problem or actually reading their code, why would the comments have to make sense?

        Oh wow, it never dawned on me that Win is like anbutechie, an account at some company that all new hires use to fish
      if (($numerator > 0) && ($denominator > 0)){ print "..."; # (print) do +es not work here
      The condition will never be true, as at least one of the variables is undef. Therefore the print will never be executed. I assume that this is the reason for the comment does not work here.