Since undef is a perfectly valid value for an element of an array, what your doing is no different than @array = ( undef ); sans the parens.
Also, while @array = () may do what you want, @array is still defined; it just evaluates as false when you test for truth (which you were).
To truly undefine @array you'd want to use undef @array; instead.
--k.
In reply to Re: undef'ing @arrays caveat
by Kanji
in thread undef'ing @arrays caveat
by vladb
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |