while () { print $_; } __DATA__ Hello world #### use warnings; use strict; while () { chomp; my @sentences = split /(?<=\.)\s*/; print '>', join ("<\n>", @sentences), '<'; } __DATA__ Hello world. Hello Bretheren. Goodbye spaces. All I really want are sentences. #### >Hello world.< >Hello Bretheren.< >Goodbye spaces.< >All I really want are sentences.<