use Modern::Perl; use Data::Dump qw/dump/; my $seq = "CTTCGAATT"; # in this case length of 9 my @strings = $seq =~ /(.{3})/g ; say dump(@strings);