in reply to Re: Re: Re: Converting relative URLs to absolute URLs
in thread Converting relative URLs to absolute URLs

But I don't know what form the urls will be in. Heres a flowchart:

open FILE1
open FILE2
while FILE1 is open take the urls out of them and use LWP::robotua to get their content url is in $_.
Parse the content for links using HTML::SimpleLinkExtor.
Take the links from linkextor and run them through uri to make them all absolute and then print them to FILE2.
When FILE1 is done, goto FILE2 and do the same thing.

How would the URI portion of this work, I can't use esskar's method because I don't know what the base or the link is, the program will have to figure that out.

Thanks

  • Comment on Re: Re: Re: Re: Converting relative URLs to absolute URLs

Replies are listed 'Best First'.
Re^5: Converting relative URLs to absolute URLs
by esskar (Deacon) on Mar 05, 2004 at 20:37 UTC
    well, if it starts with an http:// or similar, it probably will be a base
      yes I realize that esskar. The data in $_ will always be an absolute address. But how do I tell URI to only convert relative addresses if I don't know which ones are relative?

      Thanks