http://www.perlmonks.org?node_id=764165


in reply to Re: Use of unintialized value in pattern match (m//) at x.pl line 123
in thread Use of unintialized value in pattern match (m//) at x.pl line 123

I had modified my code to clearly? show myself that the variables were defined. I had no other reason why this particular 'if' statement would generate a message. The script does not fail, just generates this message. So the first if-else was just debug. The problem seems more related to the =~ compare, but again, never seen this message before on something that seemed to work in all other aspects/places. I don't want to say this, but it used to work. ;-)

  • Comment on Re^2: Use of unintialized value in pattern match (m//) at x.pl line 123

Replies are listed 'Best First'.
Re^3: Use of unintialized value in pattern match (m//) at x.pl line 123
by gibsonca (Beadle) on May 15, 2009 at 20:26 UTC
    Problem solved. The message identifies the problem at line 123, the beginning of an if-elsif-elsif-else piece of code. The problem occurred in a subsequent elsif branch, were a variable was mistyped by me. Live and learn.