in reply to Re^3: Use of uninitialized value in pattern match (m//)
in thread Use of uninitialized value in pattern match (m//)

You probably want to start by posting a new thread rather than hijacking a five year old discussion.

The perldiag man page explains what all Perl error and warning messages mean. For your error, it says this:

Use of uninitialized value%s

(W uninitialized) An undefined value was used as if it were already defined. It was interpreted as a "" or a 0, but maybe it was a mistake. To suppress this warning assign a defined value to your variables.

To help you figure out what was undefined, perl will try to tell you the name of the variable (if any) that was undefined. In some cases it cannot do this, so it also tells you what operation you used the undefined value in. Note, however, that perl optimizes your program and the operation displayed in the warning may not necessarily appear literally in your program. For example, "that $foo" is usually optimized into "that " . $foo , and the warning will refer to the concatenation (.) operator, even though there is no . in your program.

There appears to be only one variable used in your statement. That'll be the one that's undefined.


See the Copyright notice on my home node.

Perl training courses

  • Comment on Re^4: Use of uninitialized value in pattern match (m//)