in reply to how to clear an array

They do not do the same thing, but it's not worth it to worry about it. The difference is tiny.

@temp = (); only empties the array, undef @temp; completely removes it from memory. For the latter, the final memory consumption will be ever so slightly less. If you want to use the array again, the former will be just a teeny weeny little bit faster.

But like I said, don't break your head over it. The difference is negligible.