Re: how to remove an element in an array

2004-02-28 Thread R. Joseph Newton
"R. Joseph Newton" wrote: > David Inglis wrote: > > > Is there a command to drop an element from an array, or what is the best > > way to do this. > > > > Any help appreciated. > > > > -- > > Regards > > > > David Inglis > > If at all possible, design around the need. Sorry if the above was too c

Re: how to remove an element in an array

2004-02-27 Thread R. Joseph Newton
David Inglis wrote: > Is there a command to drop an element from an array, or what is the best > way to do this. > > Any help appreciated. > > -- > Regards > > David Inglis If at all possible, design around the need. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: how to remove an element in an array

2004-02-27 Thread Wiggins d Anconia
> Is there a command to drop an element from an array, or what is the best > way to do this. > > Any help appreciated. > perldoc -f delete http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: how to remove an element in an array

2004-02-27 Thread Rob Dixon
David Inglis wrote: > > Is there a command to drop an element from an array, or what is the best > way to do this. Hi David. A call to 'splice' is the usual answer, but sometimes you may want the remaining elements to keep their indices. A call to 'delete' will shrink an array if you delete from

how to remove an element in an array

2004-02-26 Thread David Inglis
Is there a command to drop an element from an array, or what is the best way to do this. Any help appreciated. -- Regards David Inglis 0408502342 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: how to remove an element in an array

2004-02-26 Thread Paul Johnson
On Sat, Feb 28, 2004 at 07:24:17PM +1100, David Inglis wrote: > Is there a command to drop an element from an array, or what is the best > way to do this. > > Any help appreciated. You're looking for splice() perldoc -f splice -- Paul Johnson - [EMAIL PROTECTED] http://www.pjcj.net -- To un

Re: how to remove an element in an array

2004-02-26 Thread zsdc
David Inglis wrote: Is there a command to drop an element from an array, or what is the best way to do this. Any help appreciated. perldoc -f splice "Removes the elements designated by OFFSET and LENGTH from an array, and replaces them with the elements of LIST, if any." -- ZSDC -- To unsubscri

Re: how to remove an element in an array

2004-02-26 Thread John W. Krahn
David Inglis wrote: > > Is there a command to drop an element from an array, or what is the best > way to do this. > > Any help appreciated. It depends. If you want to remove an element based on its contents then use grep: @array = grep $_ ne 'something', @array; @array = grep !/something/, @

Re: how to remove an element in an array

2004-02-26 Thread WilliamGunther
In a message dated 2/26/2004 6:04:59 PM Eastern Standard Time, [EMAIL PROTECTED] writes: >Is there a command to drop an element from an array, or what is the best >way to do this. > >Any help appreciated. Look into splice. delete doesn't remove elements as you may expect, just...deletes them. s

Re: how to remove an element in an array

2004-02-26 Thread David le Blanc
> I always just use this, because I hate removing elements and worrying about > it: > > use strict; > use warnings; > sub remove_el (\@@) { > my $array = shift; > my @el_rem; > for (sort {$b <=> $a} @_) { > if (! exists $array->[$_]) { > warn 'element ', $_, ' doe