$a = "http://www.myurl.com/e.php?a"; $b = "http://www.myurl.com/e.php?a"; if ($a =~ /\Q$b\E/) { print "FOUND\n"; } else { print "NOT FOUND\n"; }