/start(.*)end/s; #rather than /start(.*)end/; #used like this $file = 'C:\fixthis.txt'; open(SESAME, $file); while() { $text .= $_; } close(SESAME); print $text; $text=~/\n*$//;#get rid of trailing newlines $text=~m/^start(.*)end$/s; print $1; ########the file has this data ########## # I inserted alot of the words start and end to test it. #start #this is the start house startthat jackstart built #and i am end my fathers endchild #all end good boys do finend #and i eat end more chicken than any man that you have seen #end #############the out put is this############# #this is the start house startthat jackstart built #and i am end my fathers endchild #all end good boys do finend #and i eat end more chicken than any man that you have seen