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

Just a personal preference on my part: I never put anything other than "$filename: $!\n" in the 'die' string - because it can lead to nonsense messages like this:

test.txt: cannot find input file Is a directory test.txt: cannot find input file Permission denied

etc.

-- 
Education is not the filling of a pail, but the lighting of a fire.
 -- W. B. Yeats

Replies are listed 'Best First'.
Re^3: opening missing file inside eval statement
by apl (Monsignor) on Jan 09, 2011 at 14:02 UTC
    Agreement, though I like to say "opening '$filename': $!\n". This way, I
    • know where the problem was (as opposed to writing or positioning the file)
    • can see if there's a null or CRLF terminated string as the filename.