aboyd has asked for the wisdom of the Perl Monks concerning the following question:
1. while loop through the log files, regex matching on month/year, opening a month/year filehandle if it's not open already, and writing the line out. By the end of this process, Perl will have 36 filehandles open for writing, and 1 open for reading. Will the size of the files matter? Or will having open 36 files of 100 MB each be the same as 36 files of 10 K each?
2. loop through the month/year combinations, opening only the files needed per month. At any given point, there would only be 1 file open for reading, and 1 file open for writing. However, there would be 36 loops.
3. Some other option? My amateurish experiments so far show that the process will take hours. I'm looking to remove my regex matching and replace it with index -- I suspect that's faster. Is there anything else you might offer as advice?
-Tony
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Opine on multiple open filehandles vs. multiple loops through data
by ikegami (Patriarch) on Jan 20, 2006 at 21:02 UTC | |
by aboyd (Sexton) on Jan 20, 2006 at 21:20 UTC | |
|
Re: Opine on multiple open filehandles vs. multiple loops through data
by Fletch (Bishop) on Jan 20, 2006 at 20:59 UTC | |
|
Re: Opine on multiple open filehandles vs. multiple loops through data
by Limbic~Region (Chancellor) on Jan 21, 2006 at 15:35 UTC | |
|
Re: Opine on multiple open filehandles vs. multiple loops through data
by samtregar (Abbot) on Jan 22, 2006 at 15:57 UTC |