That did the trcik! Nice and clean, thanks Rob
> -Original Message-
> From: Hanson, Rob [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 04, 2003 2:55 PM
> To: Dan Muey; [EMAIL PROTECTED]
> Subject: RE: Modify links
>
>
> Try using URI to figure out the ab
l
http://foo.com/documents/doc3.html
http://somewhere.com/
So your regex *might* look like this (untested)...
my $base = 'http://foo.com/documents/help.html';
$html_code =~ s/href="(.*?)"/'href="' . URI->new_abs($1, $base) . '"'/seg;
Rob
-Origi
I'm trying to work out a regex that will do this:
Take an entire page's html: my $html_code; # all lines in thes one variable
And make any href's that are relative absolute by prepending $url into them:
$url = "http://myclonesite.com";;
make into http://myclonesite.com/documents/