![]() |
|
|
+ Search |
![]()
|
Dec 27th, 2001 23:48
Capt. Mooboy, Per M Knutsen,
If you want to remove the element by its positon in the array, use the
splice function. Example:
@someArray = splice(@someArray, 1); # will remove the 1st element
# Example of removing a particular element in the array:
@foo = (1,2,3,4,5);
$arrayposition = 0;
foreach $i (@foo) {
$i == 2 && splice(@foo,$arrayposition,1);
++$arrayposition;
}