Check the status of the file opens....always open(....) or die "Couldn't open file: $!" or something similar.
Update: (after listening to CB chatter) Oh. You need to escape the parens in the regex. But you know that now (though you should still check the status of file opens) :-)