in reply to Re^2: Attempting to fill a hash
in thread Attempting to fill a hash

Your file has most likely been written on Windows, and you're reading it on Unix...  You could run

$ perl -i.bak -pe 's/\r$//' your-wordlist.file

to remove the extraneous carriage returns.

Alternatively, filter the file through the crlf PerlIO layer when reading it (as it does happen on Windows by default), i.e.

open my $wordhandle, "<:crlf", $wordfile or die ...

Replies are listed 'Best First'.
Re^4: Attempting to fill a hash
by chrism01 (Friar) on Jun 06, 2008 at 05:22 UTC
    Or use the 'dos2unix' util on most Unix like systems
Re^4: Attempting to fill a hash
by TwistedTransistor (Novice) on Jun 06, 2008 at 02:23 UTC
    thank you, that fixed it all, once again I appreciate everyones help in pointing out where my code needed fixing up / rearranging, and for that tip on removing unwanted carriage returns. :-)