D
Degz
Hi,
I am working through an array testing on each element, and on a certain
condition would like to remove the current element.
My Question is, does perl have a built in variable for the current
iteration of the loop, or do I need to add my own counter. ?
My code looks something like this :
my @array=qw\one two three four five\;
foreach (@array ) {
if ( ! -s $_) {
splice(@array,[COUNTER NEEDED HERE], 1);
}
}
Many Thanks For you help
Degz.
I am working through an array testing on each element, and on a certain
condition would like to remove the current element.
My Question is, does perl have a built in variable for the current
iteration of the loop, or do I need to add my own counter. ?
My code looks something like this :
my @array=qw\one two three four five\;
foreach (@array ) {
if ( ! -s $_) {
splice(@array,[COUNTER NEEDED HERE], 1);
}
}
Many Thanks For you help
Degz.