Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Clearing an Array of Array's from memory

by bear0053 (Hermit)
on Aug 29, 2003 at 15:43 UTC ( #287722=note: print w/replies, xml ) Need Help??


in reply to Clearing an Array of Array's from memory

You can undef the array by doing the following:
undef(@myarray);
This will make @myarray = undef. I don't believe clearing it out will slow down your program any despite the size of the array.

Replies are listed 'Best First'.
Re^2: Clearing an Array of Array's from memory (=undef)
by tye (Sage) on Aug 29, 2003 at 17:57 UTC
    This will make @myarray = undef.

    I suspect this is just a case of casual, imprecise language, but you are likely to mislead people with that particular phrasing:

    my @myarray = undef; print "\@myarray contains ", 0+@myarray, " elements.\n"; __END__ Produces: @myarray contains 1 elements.
    Because     @myarray = undef;
    is the same as     @myarray = ( undef );
    which isn't at all the same as     undef @myarray;
    undef is a function that undefines what is passed to it and then returns a not-defined() scalar value.

                    - tye

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://287722]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2016-12-05 03:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (71 votes). Check out past polls.