Originally posted as an Answer to How do I completely empty out an array?

Just in case you make the mistake I did, you can't use:

@array = "";
As the @array will be assigned a 'value' and will contain one element equal to "".

Replies are listed 'Best First'.
Re: Answer: How do I completely empty out an array?
by gwadej (Chaplain) on Jan 18, 2004 at 00:27 UTC
    Good point, but you left out the real answer. Which is
    @array = ();
    This should save the new Perl programmer a little grief for not realizing the answer.
    G. Wade