in reply to How can I split a line on word boundaries closest to a certain length?

and true to the perl motto, here's yet another (much simpler) way to do it:
@text = $messagebody =~ /(.{1,140}\W)/gms;
  • Comment on Re: How can I split a line close to a certain length, but on a word boundary?