Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

How do I completely empty out an array?

by bradcathey (Prior)
on Jan 17, 2004 at 20:28 UTC ( [id://322071]=perlmeditation: print w/replies, xml ) Need Help??

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://322071]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-23 20:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found