Think about Loose Coupling | |
PerlMonks |
Re: How to get back the url of a pageby cormanaz (Deacon) |
on May 16, 2007 at 16:29 UTC ( [id://615829]=note: print w/replies, xml ) | Need Help?? |
Hmm this is more of a challenge than I expected. You can get the response object from the mech request with $mech->{res}. HTTP::Response has a method $response->is_redirect that is supposed to tell you if it was a redirect, but when I tried that, i.e. $mech->{res}->is_redirect(), with a known redirect it returned null. Maybe some other monk knows why it doesn't work. Anyway assuming the redirect is done with a refresh header, you can tell by getting $mech->{res}->header{'refresh'} I don't have a javascript direct to test it with, but I suspect it might not work for that Cheers Steve
In Section
Seekers of Perl Wisdom
|
|