in reply to split function

If you want to do something with the amino acid triplets after splitting, you can try something like this to put them into an array:
#!/usr/bin/env perl use strict; use warnings; use Data::Printer; my $prot="HKTTLDSSRTTTTAABNNRFGHGHGYYH"; my @triplets = $prot =~ /.{1,3}/g; p @triplets;

The resulting array looks like this:

[ [0] "HKT", [1] "TLD", [2] "SSR", [3] "TTT", [4] "TAA", [5] "BNN", [6] "RFG", [7] "HGH", [8] "GYY", [9] "H" ]