Yes, $#rocks = 2; made your array unaware of subsequent elements (though the memory may still be intact, but I don't think the underlying datastructure can be reverted easily); however $#rocks = 99; probably overwrote the memory forever with undefs. I don't know what memory managment magic is invoked here, but I think on a high level that's an accurate way to think about it.