Hi monks, I am new to perl and currently I writing a perl script for manipulating large data with hel of lookup in hash. I have lookup file with (created from database) phone-number,group-id,start-dat,end-dat values , this file will have 100k records and i get have a file with phone number(both calling and caled number ) and call time . so i have to look up the calling number and called number in the look up file to get the group id and start time and end time. I thought of pushing all 100k records to hash from the file and the do the comparison, but I am stucked at the point, which value should be given as key value.what i understood from tutorial that key value should be unique, but in my case first I thought of putting phone number as key, but there is always a chance the phone number can be blong to differnt group for different startdate and end date.I cannot overwrite the old data also. I have mainly two concerns 1>100k records fetching to a file and push that data to hash at the begginning of the script is better or directly accesing database and push data to hash is better approach. 2>how can make unique key with these combination or is ther any way out of it? plz hel me... thax in advance

In reply to how to define key for a hash by Anonymous Monk

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.