my $pairs = "a2" x ((length $dna)/2); # The x operator (perldoc perlop) repeats LHS string times the RHS $seq{$_}++ for unpack $pairs, $dna; # Break string up into a list of 2 char strings # Increment the corresponding hash value by 1