Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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?
Replies are listed 'Best First'.
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 drinking their drinks and smoking their pipes about the Monastery: (10)
As of 2015-07-31 10:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (276 votes), past polls