Schulz, Konrad wrote:

Has somebode got an idea how to solve this problem? I think the question
mark would be the problem when it comes to compare queries since this is a
metacharacter so I think there would be need for a way around those
characters in general...
The eq() methode of URI::URL is not working at all!
Perl has a quotemeta() function and a \Q metasymbol that can be used
in the regex itself to quote metacharacters:

$url1 = quotemeta($url1);
if ($url2 =~ /$url1) { # do something }

- OR -

if ($url2 =~ /\Q$url1/) { do something }

Simple test program for \Q:

use strict;

my $x = '&*#$';
my $y = '&*#$';

print (($x =~ /$y/) ? "YES\n" : "NO\n");
print (($x =~ /\Q$y/) ? "YES\n" : "NO\n");

--
Steve Sapovits    GSI Commerce, Inc.    http://www.gsicommerce.com
[EMAIL PROTECTED]


Reply via email to