$/ = "" ; while (<>) { s/\nstart_of_block.*?};//s print ; }