in reply to Re: Use of Hash For Table Lookup
in thread Use of Hash For Table Lookup


My hash will have up to 1000 entries, so I need to read
the CSV to create the %User hash. Can you give me any
ideas or code samples that would show my how to do this
with the code I included in my question?

Replies are listed 'Best First'.
Re^3: Use of Hash For Table Lookup
by blazar (Canon) on Aug 17, 2007 at 16:37 UTC
    My hash will have up to 1000 entries,

    This is hardly relevant

    so I need to read the CSV to create the %User hash.

    This hardly follows from the previous remark.

    I still can't understand whether you have two separate programs because you have to or just because of a circumstance. Anyway, reading from the CSV and from the file created by your poorly reinvented D::D code wouldn't make such a difference: thus do you really need that intermediate passage?

    Can you give me any ideas or code samples that would show my how to do this with the code I included in my question?

    Well, it can't be done with the code you included in your question. Otherwise you wouldn't be asking here. OTOH several suitable suggestions have already been given to you, perhaps you should comment them explaining why you don't find them satisfactory.

Re^3: Use of Hash For Table Lookup
by xorl (Deacon) on Aug 20, 2007 at 13:08 UTC
    If you insist on using the CSV file instead of the good solutions already provided, I'd suggest looking into Text::xSV to read back the data in the CSV file and generate your hash in the 2nd script. Heck if you're going to write the file, I'd use it there as well.