develooper Front page | perl.beginners | Postings from July 2003

Search and Insert into Hash

Thread Next
From:
bseel
Date:
July 14, 2003 12:24
Subject:
Search and Insert into Hash
Message ID:
363801FFD7B74240A329CEC3F7FE4CC47C1F90@ntxboimbx07.micron.com
What I am trying to do is to take lines out of a file that are formatted like:

SYSTEM="value1" DOMAIN="value2" etc.

There are about 1000 lines like that and what I need to do is to take all of the keys (like system and domain) and put them into a hash. But each of those keys has multiple values that it can have. I need to then stick the values that each one has throughout the file into an array, and put the array into the hash. It will be like this:


KEYS                     VALUES
system                [value1, value2, value3...]
domain                [value1, value2, value3...]

I then need to print them out. How would I go about doing this?

Thank You

Brian

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About