in reply to Using punctuation to split a text

This is a similar approach to GrandFather's and BrowserUK's but uses split and map to break the text up. The regular expression allows for a split between punctuation and a lower-case letter to cope with "TRUE! nervous" which you break over two lines. Here it is

use strict; use warnings; my $rxBoundary = qr {(?xms) (?: (?<=[a-z])(?=[A-Z]) | (?<=[.!?])(?=\s?[A-Za-z]) ) }; my $text = <DATA>; chomp $text; print map {qq{$_\n\n}} split m{$rxBoundary}, $text; __END__ The Tell-Tale HeartEdgar Allen PoeTRUE! nervous, very, very dreadfully + nervous I had been and am; but why WILL you say that I am mad? The d +isease had sharpened my senses, not destroyed, not dulled them. Above + all was the sense of hearing acute. I heard all things in the heaven + and in the earth. I heard many things in hell. How then am I mad? He +arken! and observe how healthily, how calmly, I can tell you the whol +e story.

and the output is

The Tell-Tale Heart Edgar Allen Poe TRUE! nervous, very, very dreadfully nervous I had been and am; but why WIL +L you say that I am mad? The disease had sharpened my senses, not destroyed, not dulled them. Above all was the sense of hearing acute. I heard all things in the heaven and in the earth. I heard many things in hell. How then am I mad? Hearken! and observe how healthily, how calmly, I can tell you the whole story +.

I hope this is of use.

Cheers,

JohnGG