in reply to Re^2: Alternative to Substr?
in thread Alternative to Substr?
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})/; }
|
|---|