I need to follow some links using LWP (simple). However, some of the links are relative. Does anyone have an easy way to parse a relative URL to complete it? TIA.
Unless the developer was lazy and made their relative links start with ./blah/blah.html (start from the current directory and move from there). To capture that, you'd want to also store the path from the doc root to the current file.
IN a situation like this, suck it and see, but there's no guarantee it'll work on all servers because they may be configured to redirect differently.
It's such a general problem, my guess is you're going to either have to spend a lot of time looking for a generic answer, or play about with a few variants, and put them in a compound if, and depending on the status (ie 404) try another tack.
Just another €0.02
Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
Thanks. Not very satisfying but at least I was right in my understanding of the problem. You are correct, it will require a lot of complex code to try and cover as many bases as possible.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.