#! /usr/bin/perl -w use strict; my @Array = ('AAA','BB','CCCC','DD','EEEEE','FFF','GGGG'); my $num_of_skip = 2; # Keep and increment your own index. for changes the loop var on you my $i = 0; while ($i < @Array) { # Adjust the index if necessary # Q: How can i make use of $num_of_skip here? A: Like this: $i += $num_of_skip + 1 if (length ($Array[$i]) == 2); # Notice we're post-incrementing the index here too print "$Array[$i++]\n"; }