for(my $i = 0; $i < @ARGVl $i++) { if($ARGV[$i] =~ /meets some condition/) { # ack! the index has been offset $i += 2; } }