http://www.perlmonks.org?node_id=978542


in reply to pattern matching compilation errors

Without wanting to repeat what others said before me, there's one part in this line that stood out to me.

open(FILE,"<",$filename1) or die "\n...Cannot find the file: $filename +";

Namely, the error message. "Cannot find the file" might not be the best to put there. There could be all sorts of other reasons the file couldn't be opened. Perhaps the process doesn't have the right permissions, maybe the file is locked, maybe there are tons of other things that could go wrong. But that's okay, because you can make Perl tell you (more or less) exactly what went wrong!

... or die "\n... Can't open $filename: $!\n";

Replies are listed 'Best First'.
Re^2: pattern matching compilation errors
by Kenosis (Priest) on Jun 27, 2012 at 01:49 UTC

    Good eye, muba!