#Here's code that finds everything #between START and END in a paragraph: undef $/; # read in whole file, not just one line while ( <> ) { while (/START(.*?)END/sgm) { # /s makes . cross line boundaries print "$1\n"; } }