Forum Moderators: coopster & phranque

Message Too Old, No Replies

Regex stopped working after server perl upgrade

Server now using perl 5.8.0 for i386-linux-thread-multi

         

ga_ga

12:45 pm on Oct 1, 2003 (gmt 0)

10+ Year Member



I have a regex which used to work fine, but since an upgrade of perl on the remote server to version 5.8.0, it no longer does:

$x =~ s/<p>wordage <a href='http:\/\/www.domain.com\/page.html'>wordage<\/a><\/p>//i;

The idea being to take $x, and remove a paragraph containing a link.

This regex on the other hand, which sits one line above the faultily-coded one, does still work, chopping out a few table tags from $x:

$x =~ s/<\/td><\/tr><\/table>//i;

Very confused after a few hours puzzling over this, does anything obvious leap out at somebody with greater experience than myself.. Thanks very much for any suggestions :)

Server OS is Red Hat Linux & server itself is Apache/2.0.40

Top few lines of my script:

#!/usr/bin/perl -w
use LWP::Simple;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use warnings;

print "Content-type: text/html\n\n";

ga_ga

12:05 am on Oct 2, 2003 (gmt 0)

10+ Year Member



Resolved now - I was actually adding a die statement after the regex; it wasn't finding what it was looking for, simple as that (although it was unclear to me at the time), and was die-ing, returning an error to the browser telling me to look for the cause on that line. Hang my head in shame.