vitoco has asked for the wisdom of the Perl Monks concerning the following question:
Can someone point me where can I get some working examples on the use of handlers of LWP:UserAgent? From the docs:
$ua->remove_handler( $phase, %matchspec ) $ua->remove_handler( $phase, %matchspec )
I want to understand what are %matchspec in this context and how to successfully remove the ones I've added.
I'm using Mechanize to read some HTML pages and get some links to binary files. To trace the binary downloads, I added a simple handler using:
$mech->add_handler(response_header => \&mytrace);but I couldn't successfully remove it after the $mech->get() by analyzing the hashes from the following code after de add, in the middle and at the remove:
$mech->handlers('response_header', $mech->response())If required, I can post some code and it's output...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: LWP handlers examples?
by ikegami (Patriarch) on Aug 12, 2009 at 18:02 UTC | |
by vitoco (Hermit) on Aug 12, 2009 at 19:42 UTC | |
by almut (Canon) on Aug 12, 2009 at 21:51 UTC | |
by vitoco (Hermit) on Aug 13, 2009 at 18:37 UTC | |
by ikegami (Patriarch) on Aug 12, 2009 at 20:06 UTC | |
by vitoco (Hermit) on Aug 12, 2009 at 20:59 UTC | |
|
Re: LWP handlers examples?
by Anonymous Monk on Aug 13, 2009 at 03:54 UTC |