in reply to assigning hash key to reference of array question
When writing code like this, I find that I just have to grab a number-two pencil and a piece of paper and write down what I want the computer to do. It looks to me like you are unintentionally creating “a reference to a reference.”
When you put a complex piece of data “into” an array or a hash, what actually happens is that you put “a reference to that data” there. “A reference” is, effectively, a scalar. It is, in other words, “a Thing,” separate from “the other Thing” that it refers to. You need to be sure that, when the dust settles, you wind up with “two references to the same Underlying Object,” not “a reference to a reference.”
It’s tricky to do. (Heck, it’s hard enough to explain...)
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: assigning hash key to reference of array question
by ikegami (Patriarch) on Feb 28, 2011 at 21:01 UTC |