does it mean that all items with indexes like ij with i=>2&&j>1 remain available ?
No. The array @all_with_name is cleared. The element at position 1 in the array reference in $all_with_names[2] has been copied to $gilligan_stuff, so it is there. If the thingy copied was a plain scalar, $gilligan_stuff holds a brand new copy of the contents of the array slot $all_with_names[2][1].
But if the entry in that slot was a reference, by copying that to $gilligan_stuff the reference count of the thingy that reference points to was increased, and the reference in $all_with_names[2][1] pointed to the same thingy.
By destroying the array @all_with_names the original data $all_with_names[2][1] was pointing to has not been deleted, although the slot $all_with_names[2][1] has been destroyed - only the pointer has been deleted. The reference count of the underlying data was decreased by deleting the array which held a reference to it, but until that count goes to zero the data is still allocated and accessible (if you have a refrence :-).
HTH,
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
In reply to Re: deleting array references
by shmem
in thread deleting array references
by spx2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |