Dear Monks, How to dynamically remove array elements? For example, I want to remov +e certain elements of @array whose indices are stored in @arrayindex. + However, when I try to execute the code below, it does not work beca +use in each loop the length of @array changes thus making the origina +l index values (stored in @arrayindex) inappropriate. foreach my $i (@arrayindex) { splice(@array, $i, 1); } Any suggestions on how this should be done. Thanks Monks.
In reply to Remove array elements dynamically! by newbio
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |