Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Re: From: array To: complex hash

by markguy (Scribe)
on Jul 07, 2003 at 17:19 UTC ( [id://272032]=note: print w/replies, xml ) Need Help??


in reply to Re: From: array To: complex hash
in thread From: array To: complex hash

Thanks pete, that seems to be just what I'm looking for. In an attempt to further my own knowledge while unfortunately looking like a complete newb at this perl stuff, is there any way I can con you into explaining how you arrived at that particular solution?

Thanks to everyone else's input... it's appreciated.

Replies are listed 'Best First'.
Re: Re: Re: From: array To: complex hash
by dreadpiratepeter (Priest) on Jul 07, 2003 at 18:11 UTC
    I know that each element in the list is going to be a pointer to the one before it. I just save off a reference to where the next insertion should take place. Each time through I create a anonymous hash, insert it into the current hash (the key is the array element, the value is the anonymous hash) and store out a reference to the new hash for the next time through the loop.

    Hope that's clear. I'm much better at writing the code than explaining it in english.

    -pete
    "Worry is like a rocking chair. It gives you something to do, but it doesn't get you anywhere."

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-26 00:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found