Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: How to define a package using a tweaked version of LWP::UserAgent?

by spacebat (Beadle)
on Jul 31, 2008 at 07:37 UTC ( #701358=note: print w/ replies, xml ) Need Help??


in reply to How to define a package using a tweaked version of LWP::UserAgent?

This might sound inelegant, but what I've done in the past is inject a subroutine into the LWP::UserAgent package that occludes the original get_basic_credentials(). I define this routine either to supply the credentials directly, or make it a closure so I can use it to install a callback.

I know its probably pretty far from best practice. I also think having to subclass the useragent to supply credentials is a bit naff.


Comment on Re: How to define a package using a tweaked version of LWP::UserAgent?
Re^2: How to define a package using a tweaked version of LWP::UserAgent?
by pwolfenden (Novice) on Jul 31, 2008 at 14:46 UTC

    How exactly did you "inject" the subroutine? I'd love to see an example where you make it a closure and then install a callback method.

    Thanks!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://701358]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (11)
As of 2014-10-21 20:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (109 votes), past polls