my @substrings; { my $size = 10; no warnings 'substr'; push @substrings, substr($string, 0, $size, '') while $string; }