$ perl -wE 'my $x = qq{abcd\nefgh\nijkl}; say ">$x<"; say ">$1<" while $x =~ /(.{3})/gs' >abcd efgh ijkl< >abc< >d e< >fgh< > ij<