my $kette = "abcdefghijklmno";
my @splitted = $kette =~ /.../g;
my @splitted = split(/(...)/, $kette);
1
2
3
4
5
6
7
8
9
10
11
perl -wle '
my @splitted = split(/(...)/, "abcdefghij");
print ">$_<" for @splitted;
'
><
>abc<
><
>def<
><
>ghi<
>j<
1
2
3
4
5
6
7
8
$ perl -wle '
my @splitted = map { length $_ ? $_ : () } split(/(...)/, "abcdefghij");
print ">$_<" for @splitted;
'
>abc<
>def<
>ghi<
>j<
my @splitted = grep { length $_ } split(/(...)/, $kette);
my @a = unpack '(A3)*', $kette