You are making hard work of it. Modulus % is good for skipping N items and you can increment at the same time. You have $count and $count2 FWIW -> use strict to get told the error of your ways by Perl.
my $count = 0; for my $input (@input) { next unless $count++ % 2 == 0; print "Got $1\n" if $input =~ m/DosID=(.{6})/; }
In reply to Re^3: Alternative to Substr?
by tachyon
in thread Alternative to Substr?
by New Novice
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |