in reply to negative look ahead

if you want to use look ahead assertion you can do it like this
with positive look ahead assertion:
my $string = qq*<sec>here the text goes <pg> and text continues*; my ($match) = $string =~ /(<sec>.*)(?=<pg>)/;
which will match from the <sec> up to the <pg>
look at perldoc perlre for some great documentation