Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: opening missing file inside eval statement

by oko1 (Deacon)
on Jan 08, 2011 at 23:30 UTC ( #881284=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://881284]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2016-09-28 17:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (533 votes). Check out past polls.