in reply to Simplifying my script...
Opening a pipe from cat to read a single file is just wrong. Just open the file for reading. perldoc perlopentut, perldoc -f open.