in reply to Re^2: how to push multiples row of values into hash and do comparison
in thread how to push multiples row of values into hash and do comparison
Before addressing your comment, let me clear up one point of confusion. In perl, the term 'global variable' means the same thing as 'package variable' (declared with 'our' or 'use vars'). You did not declare any of these. By moving the declaration, you increased the scope of a lexical variable to include the entire file.
when you see a message that a variable is not declared, it can mean any of several things.
The solution is 'smallest possible scope'. Move the declaration not to the start of the file, but to the start of the smallest block which includes every necessary use of the variable.
|
|---|