in reply to Regular expression help: why does this not match?
#!/usr/local/perl $a = "http://www.myurl.com/e.php?a"; $b = qr|http://www.myurl.com/e.php\?a|; if ($a =~ /$b/) { print "FOUND\n"; } else { print "NOT FOUND\n"; } $a = "http://www.myurl.com/e.php"; $b = "http://www.myurl.com/e.php"; if ($a =~ /$b/) { print "FOUND\n"; } else { print "NOT FOUND\n"; } $a = "http://www.myurl.com/e.php"; $b = "http://www.myurl.com/e.php"; if ($a eq /$b/) { print "FOUND\n"; } else { print "NOT FOUND\n"; }
|
|---|