Ignore me if i'm talking poo, (especially since I didn't see the original
message),... but surely splice() would be best suited for working with an
ARRAY, but you all seem to be talking about hashes... sooo....



----- Original Message -----
From: "Brett W. McCoy" <[EMAIL PROTECTED]>
To: "Walt Mankowski" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, May 29, 2001 8:49 PM
Subject: Re: How to delete an element in array?


>
> On Tue, 29 May 2001, Walt Mankowski wrote:
>
> > On Tue, May 29, 2001 at 11:59:18AM -0700, Randal L. Schwartz wrote:
> > > >>>>> "Brett" == Brett W McCoy <[EMAIL PROTECTED]> writes:
> > >
> > > >> Uh, careful.  This got added to 5.6.1 to support pseudo-hashes and
is
> > > >> probably coming back out when pseudo-hashes get removed in 5.10.
> > > >> ("Death to pseudo-hashes!")
> > >
> > > Brett> Argh.  I didn't realize that.  Is this specifically delete on
array
> > > Brett> elements?
> > >
> > > Yes.
> >
> > Is there any difference in 5.6.1 between
> >
> > delete $array[$index];
> >
> > and
> >
> > $array[$index] = undef;
> >
> > There doesn't seem to be from the man page.  If there's not, it
> > doesn't seem to be a particularly useful feature.
>
> I think the difference is what 'exists' returns.  Undefining an element
> still leaves the element in the array ('exists' would return true, but
> 'defined' would not).  This is the case with hashes, isn't it?
>
> -- Brett
>
> Brett W. McCoy
> Software Engineer
> Broadsoft, Inc.
> 240-364-5225
> [EMAIL PROTECTED]
>
>
>

Reply via email to