in reply to Resetting variables
at the top of the program -- you should do that. Then I declared and initialized where necessary ($word_len and $tot_found need initial values), and ran the program without a problem (although it doesn't do anything interesting).use strict; use warnings;
The error you describe strikes me as very quirky. You might get around it by tacking the "o" (compile once) option onto the regex:
/[[:alpha:]]/o
|
|---|