Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re(4): undef'ing @arrays caveat

by dmmiller2k (Chaplain)
on Apr 20, 2002 at 23:12 UTC ( #160820=note: print w/replies, xml ) Need Help??

in reply to Re: Re: Re: undef'ing @arrays caveat
in thread undef'ing @arrays caveat

Granted. But besides the speed issue, the result is effectively the same.

In the case of undef @array, @array does not actually get undefined (i.e., it still exists), just emptied, however more efficiently than with @array = ().

Replies are listed 'Best First'.
Re: Re(4): undef'ing @arrays caveat
by Juerd (Abbot) on Apr 20, 2002 at 23:19 UTC

    @array does not actually get undefined

    undef can only un-define scalars, because only scalars can be not-defined. Hashes and arrays are emptied, subs and globs are destroyed. I think the manual is not clear enough about this.

    - Yes, I reinvent wheels.
    - Spam: Visit eurotraQ.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2018-07-22 20:54 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (455 votes). Check out past polls.