Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: print or die?

by fishmonger (Chaplain)
on Mar 14, 2014 at 14:20 UTC ( #1078336=note: print w/replies, xml ) Need Help??


in reply to print or die?

I've never felt the need to test every print statement when writing to files and so far I've never come across a situation where the print statement failed, but there are rare cases where it can occur.

If I were going to go down that path, I'd write a sub (lets call it printing) that accepted at least 2 parameters; the first being the filehandle and the rest the data to be printed. Then do the print statement and apply whatever error handling I deemed appropriate (warn or die), which would probably also include the use of the caller() function.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1078336]
help
Chatterbox?
[Marshall]: I looked at MS specs for PE format and I didn't see any changes in last decade, but evidenly that would be wrong.

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2016-12-08 18:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (144 votes). Check out past polls.