in reply to eval horrors

Since you don’t seem to care to check for errors, you had better put this at the top of your program:
use 5.10.1; use autodie;
Alternately, check your opens:
open(F, "<", $filename) || die "can't open $filename: $!";
I also suggest you get used to using parentheses around your function calls to make them easier to read and parse, although that isn’t really the problem here.