Fellow Monks,

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

my %positions = (1 => 8, 9 => 11, 20 => 2, 22 => 9, 31 => 7, 38 => 8, 46 => 8, 54 => 8, 62 => 30, 92 => 12, 104 => 30);
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 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,

Grygonos

In reply to Managing Client Specific Hashes by Grygonos

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.