A crude way of doing this without a module would be:
my $foo = '12345678901 23456789012345678901234567890123456789012345678 +901234567890123456789012345678901234567890'; + my $n = 15; + my @chunks = ($foo =~ /(\S{0,$n})\s?/g); + print join "\n",@chunks;
/J\
In reply to Re: breaking up lines along white spaces with max length
by gellyfish
in thread breaking up lines along white spaces with max length
by szabgab
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |