in reply to Re: splitting a sequence using unpack
in thread splitting a sequence using unpack

if it's necessary to have the triplets in an array, this should do it.
my $seq = "atgcatccctttaat"; my @triplets = $seq =~ /(...)/g; print "$seq: ", join(",", @triplets), "\n";

and if the last "triplet" can have only one or thwo characters, just change the regex.

my @triplets = $seq =~ /(.{1,3})/g;

as i agree with demerphq that unpack should be faster than a regex, it's just far more readable what's going on by using regular expressions. tune your code with unpack if the script is too slow.
btw. if you don't know what a funktion does, just type perldoc -f unpack ;-)