http://www.perlmonks.org?node_id=274235


in reply to Is there a Limit on Matching .*

Exactly what I was thinking sauoq

$chunk =~ m%<title>(.+)</title>.*<h1>(.+)</h1>%i;
Is looking for everything on one line, so it will not match unless everything <title></title><h1></h1> is on the same line.

Where: $chunk =~ m%<title>(.+)</title>%i;

And:$chunk =~ m%<h1>(.+)</h1>%i;

is matching each thing on their own lines.