Looking at the LWP::UserAgent manual page and grepping for
redirect gives a couple of options you can give as a parameter for
new that may do what you want. Searching for
redirect further down gives you a couple of useful handlers you can use. And even further down, we stumble upon:
$ua->simple_request( $request )
$ua->simple_request( $request, $content_file )
$ua->simple_request( $request, $content_cb )
$ua->simple_request( $request, $content_cb, $read_size_hint )
This method dispatches a single request and returns the res
+ponse
received. Arguments are the same as for request() describe
+d above.
The difference from request() is that simple_request() will
+ not try
to handle redirects or authentication responses. The reque
+st()
method will in fact invoke this method for each simple requ
+est it
sends.
And if that's not enough, there's more that a search for
redirect reveals in the manual page. There's also the
redirect_ok callback.
Wouldn't you agree that grepping manual pages is much faster than writing a post on Perlmonks and waiting for an answer?