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


Comment on Re: File APPEND/OVERWRITE
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://952667]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2015-07-02 00:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (25 votes), past polls