Re: Use of uninitialized value Error





David Gilden wrote:

Hello,

Hello,

In the Script below the line: last if ($num >= 35)
is giving me this error: Use of uninitialized value in int


How do I avoid this error?

a) Initialize it :)

  my $num = 0;

b) don't use warnings - but don't do that

c) turn off uninitialized wanrings (see perldoc warnings) - but don't do that either


Also please use strict, expecially on "problem" code you're posting to the list for help on. IN this case you waould have gotten an error about this unless I looked at it wrong.


HTH
.