But Perl is right when it issues that warning! If you would use strict;, Perl would even have caught your underlying programming error. The array @whenfound is declared only in your sub argscan { ... }. Perl sees you use another array @whenfound in your main program, and warns you that you only ever use this array once, in line 54, which is correct.
You should read about the strict pragma and add the line use strict; before the line use warnings; in your program. Then you should go through your script and fix all the places where a variable is used but has not yet been declared, by declaring that variable either through use vars '$variable'; or by my $variable;, depending on whether you want that variable to be a global variable or a local variable.
After you've such declared the scope of all your variables, you will in the course also have found the logic errors in your program that were caused by using variables before they even got assigned a value.
In reply to Re: Confused about 'Name "main::whenfound" used only once:'
by Corion
in thread Confused about 'Name "main::whenfound" used only once:'
by Maze
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |