分类: Python/Ruby
2011-10-20 22:02:41
Perl recycles the memory for the array only when all references (including the name of the array) go away. In this case, Perl only reclaims memory when @array and all the references we created to it disappear.
At this point, the five-element list is in an anonymous array, which is a fancy term for an array without a name.
The data stays alive until we destroy the last reference:
$ref = undef; #