Hello Masters,

I've been trying to come up with a logic for a problem, that im not able to figure out flow diagram. Its been 2 days. I really seeking help.

Task: I have a hash table which i created from csv file. Using hash table keys/values, need to replace certain blocks. In csv file there is repetition data in column 2. Column 2 is referred as Hash->values. Need to replace certain a set of logic to each repetitive data.

Example:

Column1: set of names_random, defined as {name1, name2, name3, name4,.....name200}

Column2: groups column1 data belong to, defined as {group1, group2, group1, group4, group2, group7, group4....group5}

Each data of column1 is associated to a group in column2.

Since these data are stored in hash table, what is the good logic to read column2 and place certain bunch of logic.

I'm trying to figure out and confused like do i need to store hash table and create a subroutine to read hash data from a file and access hash->values by pattern matching, if pattern matches replace these logic by entering to for loop or while loop.

I dont know where to start from. Please help by providing feedback through good way to implement logic.

Thanks in advance.


In reply to read hash table from a subroutine or retrieve previously stored hash table from a file by waytoperl

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.