in reply to Tell me how it works!
Because *a is implicitly a collection of pointers to the various $a, @a, etc values. So *b = *a copies those pointers, and undef *a wipes out the original collection of pointers, but not the copy.
Update: my apologies, I omitted one level of indirection. I am grateful to brother citromatik for pointing out the error of my ways. (I will now go and mediate on the problem of hubris.)
Correcting my earlier explanation... What is happening is that *a implicitly refers to a structure which contains a collection of pointers to the various $a, @a, etc values. So *b = *a makes *b implicitly refer to the same structure as *a. The operation undef *a wipes out the implicit reference -- it does not affect *b, or the structure, or the values pointed to by that structure.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Tell me how it works!
by citromatik (Curate) on Jan 28, 2009 at 15:01 UTC | |
by nagalenoj (Friar) on Jan 28, 2009 at 15:13 UTC | |
by massa (Hermit) on Jan 28, 2009 at 15:28 UTC | |
by gone2015 (Deacon) on Jan 28, 2009 at 16:56 UTC | |
by nagalenoj (Friar) on Jan 29, 2009 at 05:43 UTC | |
by ikegami (Patriarch) on Jan 29, 2009 at 15:36 UTC |