in reply to find a string into an interval

You may be looking for something like this (if you only want data literally between the strings). Note the /s allows . to match newlines.

#!/usr/bin/perl local $/; # undef input record separator my $str = <DATA>; # get all file DATA into string my @matches = $str =~ m!str1(.*?)str2!gs; print @matches; __DATA__ str1 Hello str2 str1 World str2 str1 ! str2

cheers

tachyon