#!/usr/bin/perl $first = "Four Score and Seven"; $last = "thank you and now go to hell."; $para = <<'EOF'; Blah blah and stuff. EOF open(IN, "); close(IN); $file =~ s/$first.*$last/$para/sm; open(OUT, ">file.txt.new"); print OUT $file; close(OUT);