if ($head=~/$cont/) { print "We have a match\n"; } else { print "No match\n"; }