Page is a not externally linkable
- Code, Content, and Presentation
-- Perl Server Side CGI Scripting
---- Ignoring certain regex matches


lindajames - 9:09 pm on Jan 30, 2004 (gmt 0)


sugarkane mentioned that i can use the following:

$content=~s/Error Pages/Er1234567ror Pages/g;
if ($response->is_success && $Content!~ /error/i) {
$content=~s/Er1234567ror Pages/Error Pages/g;
# carry on with whatever you're doing if 'error' is found
}
else {
$content=~s/Er1234567ror Pages/Error Pages/g;
# carry on with whatever you're doing if 'error' is NOT found
}

but the problem is i cannot get it to work with my code. my code looks as follows, can anyone please help me get the above code to work with the code below where it reads if ($response->is_success && :

my $request = GET $query_string;

$request->authorization_basic($User_name, $Password);

my $response = $ua->request($request);
$Content = $response->content;

if ($response->is_success && $Content!~ /error (?!pages)/i) {
return $response->content;
}
else {
$Error_msg = $response->message;
return undef;
}
}


Thread source:: http://www.webmasterworld.com/perl/3438.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com