Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: Get hangman words from text file

by kennethk (Abbot)
on Dec 04, 2012 at 22:31 UTC ( #1007165=note: print w/replies, xml ) Need Help??

in reply to Get hangman words from text file

The error Global symbol "@hangman" requires explicit package name... means that whatever code you are actually running is using strict but does not declare @hangman, perhaps via my or our. You can use diagnostics if you need more clarity on an error message. See Use strict warnings and diagnostics or die. Basic debugging checklist wouldn't hurt either.

Seeing as your demo code does not emit any errors and there is no such mention in the "along the lines of" code, you need to post the code you are actually running, so we can provide guidance. Your posted code is grossly in line with what you need to do, though my open would likely look more like open my $fh, '<', 'words.txt' or die "Open fail on words.txt: $!\n";

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1007165]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2018-05-23 17:45 GMT
Find Nodes?
    Voting Booth?