my $string = 'this is a test message'; my ($chunk) = $string =~ /(.{1,12})\b/;