use strict; use warnings; @_ = ; s/^\s+|\s+$//g for @_; $_ = join "\n", @_; ##### END OF LINE MARKERS s/([^\.\?!\n])\n+/$1 /g; ##### ADD TO AS NECESSARY print; __DATA__ This line breaks in the middle. This one doesn't. Neither does this! Or this? I hope.