[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Re: clearing an array



>Will the following clear an array totally from memory?
>
>%array = ();
>
>
> or does it just zero all the elements thereof?
>
>The reason I am asking is I am getting "out of memory" errors and I could
>zero the arrays after use.  This would free up memory by 75%!
>
>TIA
>
>Jann

According to the Camel book:

    undef EXPR

    undefines the value of EXPR ... use only on a scalar value, an
    entire array or hash, or ... Any storage associated with the
    object will be recovered for reuse (though not returned to the
    system, for most versions of UNIX) ...

Thus:

    undef %array;    # should do what you want

 -Paul-     paul.b.patton@hbc.honeywell.com

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch