Ok. I am confused. Isn't 'delete' an operation for hashes only?
Javier Moreno
==============
Softtek/GXS
EFS NearShore
...when you have eliminated the impossible, whatever remains, however improbable, must be the truth.
- Sherlock Holmes
-----Original Message-----
From: Ricardo SIGNES [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 03, 2002 2:35 PM
To: Jenda Krynicky
Cc: [EMAIL PROTECTED]
Subject: Re: Removing the nth element from an array
On Thu, Oct 03, 2002 at 06:43:14PM +0200, Jenda Krynicky wrote:
> From: "Philip Morley" <[EMAIL PROTECTED]>
> > How do you remove the nth element from an array?
> >
> > Suppose I have an array @numbers = (1, 2, 3, 4, 5, 6)
> >
> > and want to remove the third element, so it becomes (1, 2, 4, 5, 6)?
>
> perldoc -f splice
>
> splice @numbers, 2, 1;
>
Also consider delete.
delete $numbers[2];
--
rjbs
