Did you copy-and-paste the program, or did you retype?
I usually get this kind of message, when I accidentally forget semicolons and Perl then sees the "if" as a statement modifier.
Comment on Re^4: Filter out an input file with a given waiver file, and output to a specific file