in reply to Re: opening missing file inside eval statement
in thread opening missing file inside eval statement

this is exactly what i tried and perl didn't catch the error when the file was missing.
open (INFH, "<$file") {
I only got an error later when i tried to read from it.

Replies are listed 'Best First'.
Re^3: opening missing file inside eval statement
by Corion (Patriarch) on Jan 08, 2011 at 22:12 UTC

    What you show is not even valid Perl (or when it is, it is a snippet, meaningless in itself). Either post the minimal exact code that produces the problem for you, so we can help you better by reproducing the error ourselves. Or run the code I posted above, and look at what output it produces.