in reply to treating * as a normal character in a regex

To quote regexp metacharacters, use the  \Q ... \E quoting ops:
if($theMatch =~ /\Q$line\E/ )
-Mark