Your skill will accomplish
what the force of many cannot
LWP Questionby Anonymous Monk
|on Dec 10, 2012 at 18:34 UTC||Need Help??|
Anonymous Monk has asked for the
wisdom of the Perl Monks concerning the following question:
I have a script that reads one of my pages to test it. the page it tests, will redirect to a number of different urls.
I use LWP to contact the page and get me the html of the page it loads. Some of them are identical source code.
I need to know what URL it is redirecting to.
How can I get that from LWP?
Here is my code:
that is a section of my code.
How can I get this to only tell me the URL it redirected to? not the url it ended up on, but where it redirected to, like this: header("Location: http://mydomain.com/path1/someotherpath.php"); have it give me the redirected url: http://mydomain.com/path1/someotherpath.php, because someotherpath.php would also redirect to one other location, so I need the first one.
Can someone tell me how to do this?