Chady has asked for the wisdom of the Perl Monks concerning the following question:
Hi guys..
I'm stuck with a flat file | seperated fields database which is huge actually. and I want to generate HTML files based on the subcategory, and stuff all the other information for each subcategory in the specific file..
So my bet was to read the file line by line and create subcategory-named-files whenever a new subcategory is encountered, because the subcategories aren't sorted.
anyway, can I create filehandles that evaluate from a variable? and if I can, I might end up with about 50 filehandles opened at the end of the operation which I have to close, can I close every opened filehandle? or do I have to specify a close() for each one?
Here's an example of the data file, I trimmed down the info and messed it up.
ID|Category|SubCategory|Code|Description|Picture ex: 0|OFFICE EQUIPPMENT|PEN|PDS01|an ordinary pen|pen.gif 1|OFFICE EQUIPPMENT|PEN|PDS02|another pen|pen2.gif 2|OFFICE EQUIPPMENT|PAPER|PA003|white sheets to write on|paper.gif 3|OFFICE EQUIPPMENT|PEN|PDD50|the greatest pen|pen50.gif 4|OFFICE EQUIPPMENT|PEN|PDS01|an ordinary pen|pen.gif
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: About Filehandles
by Masem (Monsignor) on Jun 25, 2001 at 15:21 UTC | |
|
Re: About Filehandles
by ChOas (Curate) on Jun 25, 2001 at 15:15 UTC | |
|
Re (tilly) 1: About Filehandles
by tilly (Archbishop) on Jun 25, 2001 at 16:01 UTC | |
|
Re: About Filehandles
by particle (Vicar) on Jun 25, 2001 at 16:13 UTC | |
|
Re: About Filehandles
by mattr (Curate) on Jun 25, 2001 at 16:35 UTC | |
|
Re: About Filehandles
by CharlesClarkson (Curate) on Jun 25, 2001 at 17:56 UTC | |
|
Re: About Filehandles
by PetaMem (Priest) on Jun 25, 2001 at 15:17 UTC | |
by Sifmole (Chaplain) on Jun 25, 2001 at 16:23 UTC | |
|
Re: About Filehandles
by perchance (Monk) on Jun 25, 2001 at 15:26 UTC | |
|
Re: About Filehandles
by bwana147 (Pilgrim) on Jun 25, 2001 at 16:16 UTC | |
|
Re: About Filehandles
by Anonymous Monk on Jun 25, 2001 at 22:44 UTC | |
|
Re: About Filehandles
by runrig (Abbot) on Jun 25, 2001 at 23:57 UTC |