open(F, "file"); while() { if (/StartPattern/.../StopPattern/) { # if matches, slurp all of this contents to a variable } close(F);