Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Arvin Portlock
September 1, 2005, 5:47 pm
rate this thread
Re: Combining multiple hash references into one hash reference
[ Please do not top-post.
Please stop top-posting very very soon.
What "danger" do you see that we can help you to avoid?
%newhash and %$newhash should both contain the same keys and values.
Good, since that _is_ what is happening.
I think maybe your question is more about the contents of this
created hash rather than about the hash itself...
The anon hash contains _copies_ of the keys and values returned
by the dererencing operation. The named hash (%newhash) also
contains copies of the keys and values returned by the dererencing
There is only _one_ $newhash scalar.
Do you mean that it will take on thousands of _values_ (hashrefs)?
That shouldn't be a problem. Perl's reference counting will free up
the old one when $newhash no longer refers to the old one.
There *are no* such hashes in any of the code above.
It may have been a dual typo on your part, but it pretty much
stops us in our tracks with regard to figuring out what you
Tad McClellan SGML consulting
firstname.lastname@example.org Perl programming
Fort Worth, Texas