's handling of line endings is also dependant. If your word list was created with Windows style line-endings, and is being accessed on a Unix server, you'll need to convert its line endings to Unix-style. You may also be able to change $/, as
's behavior is dependant on what it finds in $/. But I haven't tested this idea as a means of dealing with different platforms' line endings.