in reply to Skipping Elements in an Array
my @Array = ('AAA','BB','CCCC','DD','EEEEE','FFF','GGGG'); my $num_of_skip =2; for (my $index =0; $index <= $#Array; $index++){ if (length($Array[$index]) == 2) { $index += $num_of_skip; } else { print "$Array[$index]\n"; } }
|
|---|