in reply to Problem while refactoring code into a subroutine (was: subroutines!!!)

Your problem is that you have array references not arrays. You therefore need to access the individual elements using, for example, $dna->[$i] and not $dna[$i].

--
<http://www.dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg