Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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


Comment on Re^2: opening missing file inside eval statement
Download Code
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: (15)
As of 2014-07-29 16:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (223 votes), past polls