in reply to Splitting a string into words
This code is also a bit more readable, in my opinion.
use warnings; use strict; use Text::Wrap qw(wrap); my $phrase = 'This is a test message with lots of words in it. Tintina +bulations!'; $Text::Wrap::columns = 13; my $wrapped = wrap('','',$phrase); print $wrapped;
|
|---|