my $i = 0; my $size = 10; while (my $substring = substr($string, $i, $size)) { push (@substrings, $substring); $i += $size }