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

Re: printing to a file

by DigitalKitty (Parson)
on Apr 02, 2004 at 19:09 UTC ( #342085=note: print w/replies, xml ) Need Help??


in reply to printing to a file

Hi dudley.

I felt compelled to offer a little advice. In your open / close functions, I would include some minor modifications in the event of failure (hardware related, etc.).
open(FILE, $filein) or die "Couldn't open file $filein : $!\n"; close (FILE) or die "Couldn't close file : $!\n"; open (NEW, ">$filein") or die "Couldn't open $filein : $!\n"; close (NEW) or die "Couldn't close file: $!\n";

Even though perl will close filehandles for you, I feel it is unwise to not explicitly check for success / failure.

Hope this helps,
-Katie

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://342085]
help
Chatterbox?
[LanX]: strangely you can't disable the XP nodelet
[LanX]: But you can use CSS to hide it
[LanX]: and disoplay the data permanently in your peronal nodelet
[marinersk]: I saw that you could post it on the Personal Nodelet, but you have to provide the content also. No way to auto-populate it. Not that this would solve my distraction problem...
[LanX]: there are template variables to "Auto-populate" it
[marinersk]: Yeah, someday I might become interested enough to poke around PerlMonks more internally. Most of the fancy stuff is way down on my to do list.
[LanX]: Yeah ...
[LanX]: no variable for votes_left

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2017-05-29 14:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?