Garbage collection in perl is done by reference counting. By returning \@array, you are keeping a reference to @array, and thus it will not be garbage collected. You also have the advantage in that in perl, you are not dealing (directly) with memory addresses, so it's less likely that you'll shoot yourself in the foot.