in reply to Confused about 'Name "main::whenfound" used only once:'

I think you will find that it is the use of @whenfound in the:

unless ($found == undef) { return $whenfound[$subarg[2]]} else {return 0}
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.

The bottom line, as everyone else has pointed out, is that you should have used strict

/J\