in reply to Helping the garbage collector
In that line, you assign an empty list to $data[$i], which is a scalar. The empty list has to be "converted" to undef, so I guess that takes a little time. With this solution, all values are deleted, but they still exist. If that's what you want, for example if you want to re-fill the array, use: $_ = undef for @data; If you want to clear the entire array, use: @data = (); What you probably meant to use is:
hthfor (@data) { @$_ = (); }
U28geW91IGNhbiBhbGwgcm90MTMgY
W5kIHBhY2soKS4gQnV0IGRvIHlvdS
ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
geW91IHNlZSBpdD8gIC0tIEp1ZXJk
|
|---|