- or download this
my $len = 20;
# 345678901234567890
...
<Eight Nine Ten>
<Eleven Twelve>
<Thirteen Fourteen>
- or download this
use Text::Wrap;
$Text::Wrap::columns = 20;
#$text=~tr/\n/ /;
print wrap('', '', $text);
- or download this
my @lines = $text =~ /(.{1,$len})\s+/gm;