in reply to Assigning a file to an Array.

Instead of @words = <DICT>; do:
while (<DICT>) { chomp; push @words, $_; }

Replies are listed 'Best First'.
Re^2: Assigning a file to an Array.
by Bloodnok (Vicar) on Feb 12, 2009 at 16:58 UTC
    Hmmm, why so ?

    I prefer the chomp(@words = <DICT>); idiom myself.

    A user level that continues to overstate my experience :-))
Re^2: Assigning a file to an Array.
by elle45purple (Initiate) on Feb 12, 2009 at 16:05 UTC
    Hello Ciclamino

    Thanks alot for replying I tried using your code and it came out with this->
    ----------- Your Guess: i ----------- O Your Guess: o ---o------- O Your Guess: m -m-o------- O Your Guess: u -m-o-u----- O Your Guess: s -m-o-u-s--- O Your Guess: e -m-o-u-s-e- O Your Guess: p -m-o-u-s-e- O / Your Guess: y -m-o-u-s-e- O /| Your Guess: w -m-o-u-s-e- O /|\ Your Guess: n -m-o-u-s-e- O /|\ / Your Guess: b O /|\ / \ Sorry, the word was mouse.

    When i make a list directly in the program this does not happen.
    elle45purple