Since your existing code (with possible words in the initial array, @words includes both strict and a my declaration of @hangman (and company) the errors message isn't coming from what you've shown us.
in reply to Get hangman words from text file
We'll be better able to decipher the problem if you show us the code that actually provokes the error.
But, for a WAG, I suspect you're trying to populate @hangman from some new code -- perhaps before declaring @hangman. So, yes, amend, emend or update your OP to show us the barest snippet of code which reproduces the problem; we don't need 150 lines, most of it irrelevant to the error you cite.