How to solve your problem:
- Read the list of errors emitted by Perl
- Locate the variables which are listed. Perl helps here, as it gives line numbers.
- Determine the minimum scope required for each variable. As an example, the scope for a loop index need not be more than the loop where it's used, and most variables in functions should have their scope limited to the function in which they're used.
- Declare each variable with my, our, or local, as appropriate.
emc
"Being forced to write comments actually improves code, because it is easier to fix a crock than to explain it. "
—G. Steele