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."