HTML::ResolveLink is a module of mine to resolve any relative links found in (X)HTML to the absolute URI.
Here's how to use the module:
use HTML::ResolveLink;
my $resolver = HTML::ResolveLink->new( base => 'http://www.example.com/foo/bar.html', ); $html = $resolver->resolve($html);