in reply to Splitting a string into words
$msg = "This is a test message"; @lines = $msg =~ /(?>\s*)(.{0,11}\S)(?!\S)/g; [download]