Well, it appears there are two problems. One is that it's O/S intolerant, and doesn't handle files with CR/LF. The other is that if a word occurs twice (like 'for') it prints 'for for'.
The first problem was caused by using NOTEPAD.EXE to save some text I cut and pasted from a website to test it.
Nonetheless, example programs *should* have some sample input and output. After all, if it was a "bug in your version of Perl", how would I know what to expect if it worked?
--Chris
e-mail jcwren