I think you will find that it is the use of @whenfound in the:
The problem is that you have declared my @whenfound in a different lexical scope to the one that you are using it there in - it's not a problem early in the code as those uses are the same scope as the declaration. Because you are not using strict the out-of-scope reference to @whenfound is assumed to be to the package variable @main::whenfound to which this is the only reference and hence the warning.unless ($found == undef) { return $whenfound[$subarg[2]]} else {return 0}
The bottom line, as everyone else has pointed out, is that you should have used strict
/J\
In reply to Re: Confused about 'Name "main::whenfound" used only once:'
by gellyfish
in thread Confused about 'Name "main::whenfound" used only once:'
by Maze
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |