in reply to a regex to parse html tags

Use the s modifier, here are two that usually work:
if($stuff =~ /<head>(.*?)<\/head>/s){ $what_i_want = $1; } if($stuff =~ /<head>([^<]+)<\/head>/s){ $what_i_want = $1; }