in reply to Read and Display HTML - pages with CGI-script.

There are modules which would allow you to go through and rewrite all of the URLs, but as a much easier fix, try adding an HTML base href tag to the returned document:
my $content = $res->content; $content =~ s/(</head)/<base href="http://www.profit-position.com">$ +1/i; print $content;

Replies are listed 'Best First'.
Re: Re: Read and Display HTML - pages with CGI-script.
by Corion (Patriarch) on Sep 20, 2003 at 20:14 UTC

    ... of course, a base tag should only be added if no base tag is already present :-))

    perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web