>>>>> "Brett" == Brett W McCoy <[EMAIL PROTECTED]> writes:
Brett> On 29 May 2001, Jie Meng wrote:
>> I am a newbie. Would you please tell me how to delete an element in an Array?
>>
>> We know we can use "delelte" to remove a hash element. How about array?
Brett> Same thing. See 'perldoc -f delete'. It can be used on an
Brett> array, array slice, hash or hash slice. Note that for an
Brett> array, you will still need to 'shift' down all of the
Brett> subsequent elements since delete does not automatically shift
Brett> down the indices. See the documentation on the 'splice' and
Brett> 'shift' functions. You may also want to see what 'pop' can do
Brett> for you -- it pops off the end of the array (opposite of push),
Brett> like for stack.
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!")
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!