http://www.perlmonks.org?node_id=160759


in reply to undef'ing @arrays caveat

You can only assign lists to arrays, but what you probably forgot is that not all lists need parentheses. So effectively, this happens:

@array = (undef);
It makes your array be a single element array with undef as its only value. To empty an array, use an empty list (because there is no scalar this time, you need the parens):
@array = ();
To really destroy the array, and also reset its MAX, use:
undef @array;
See also: undef.

- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.