in reply to Re: Re: loop and counter question
in thread loop and counter question

So, what's in @dna then? Letters? Strings? If you have the sequence in a sequence $dna, you could do:
print "$_ " for $dna =~ /(?=(..))/g;

If you have individual letters in an array, you could use:

print @dna [$_ - 1, $_], " " for 1 .. $#dna;

Abigail