Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: How to create HASH with multiple values per Key

by Transient (Hermit)
on Apr 17, 2006 at 14:35 UTC ( [id://543825]=note: print w/replies, xml ) Need Help??


in reply to How to create HASH with multiple values per Key

You just need to make the hash value a reference to the Property array. The only question I would have in the matter is what if @Object had multiple values?
  • Comment on Re: How to create HASH with multiple values per Key

Replies are listed 'Best First'.
Re^2: How to create HASH with multiple values per Key
by gasho (Beadle) on Apr 17, 2006 at 14:48 UTC
    I am looping through a file that contains both Objects and Properties and storing Objects in @Objects and Properties of particular Object in @Properties e.g of the file
    <AllObjectsProperties> <Object name="O1"/> <Properties> <Prop name="P1"/> <Prop name="P2"/> <Prop name="P3"/> </Properties> <Object name="O2"/> <Properties> <Prop name="S1"/> <Prop name="S2"/> <Prop name="S3"/> </Properties> </AllObjectsProperties>
      XML::Simple or one of the other XML modules may suit your needs and save you the parsing/looping/data structure creation.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://543825]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-18 13:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found