Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: File APPEND/OVERWRITE

by kielstirling (Scribe)
on Feb 09, 2012 at 07:00 UTC ( #952667=note: print w/replies, xml ) Need Help??


in reply to File APPEND/OVERWRITE

You may want to look at opening the output files outside the main foreach loop. I suspect this is your problem. You are opening the same file each time you loop over @files. So the amount of entrees in the list will determine the amount of open file handles. If you must do it that way at least call close within the @files loop Also you should always check for any errors when opening a file.

i.e
open FH, "<file>" or die $!;

This simple check can give you back hours of your life ;)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://952667]
help
Chatterbox?
Discipulus i'm doing an hard work to convince hime to not leave perl nor pm... many direct mails too
[marto]: who?
[Eily]: "hime"? The perl princess?
[Discipulus]: oops !

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (11)
As of 2017-06-23 09:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (539 votes). Check out past polls.