Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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?
[karlgoethebier]: jedikaiti: did i ask already if you own a scope?
marto does the "it's almost home time" dance

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2017-07-21 15:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (328 votes). Check out past polls.