Grygonos has asked for the wisdom of the Perl Monks concerning the following question:
This is more a question of style than anything. I have a hash of field positions(i.e. 1,9,13) which hash to the length of the field starting at the position represented by the hashkey. Example
These are client specific. This scipt will run to extract data from data received by different clients, the client will be selected by the user.my %positions = (1 => 8, 9 => 11, 20 => 2, 22 => 9, 31 => 7, 38 => 8, 46 => 8, 54 => 8, 62 => 30, 92 => 12, 104 => 30);
My quandry is this...where do I store the field positions and their lengths? My initial though was to have a database table setup with two fields: starting position and length. I could then query those out and put them into a sorted hash. The more I got to thinking about it. I didn't want to put stress on the database(albeit small) and re-construct those hashes everytime. Is there a way that I can have the hash pre-constructed in a seperate file and import the hash into my main program based on the user selection?
Which way is better? Does the trouble of managing seperate files outweigh the load on the database and the run time of the script? Or is their some slick foo-cantation that,unbeknownst to me, will make this easier
Thanks for your input,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Managing Client Specific Hashes
by Corion (Patriarch) on Jan 13, 2004 at 14:59 UTC | |
|
Re: Managing Client Specific Hashes
by Abigail-II (Bishop) on Jan 13, 2004 at 15:01 UTC | |
by Grygonos (Chaplain) on Jan 13, 2004 at 15:32 UTC | |
by Abigail-II (Bishop) on Jan 13, 2004 at 15:37 UTC | |
by Grygonos (Chaplain) on Jan 13, 2004 at 15:49 UTC | |
by Abigail-II (Bishop) on Jan 13, 2004 at 15:56 UTC | |
|