Because using $#array causes some magic to be attached to the array.Technically speaking, a temporary magic object is created that points to the array. When the object is assigned to, it truncates the array. This object is freed (well, returned to the pool anyway) at the end of the statement. The array itself never gains any magic.
Dave.
In reply to Re^4: Shrunk array takes more memory than original
by dave_the_m
in thread Shrunk array takes more memory than original
by kroach
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |