Question

Some modules on CPAN use the LWP::UserAgent module. Some of these modules provide the ability to set attributes which are then used by the module with the UserAgent object. However, some of them do not provide such a mechanism. In such a case what is the best way of passing the attributes to the UserAgent object in the module? Specifically, I am interested in proxy attributes and the agent string.

My first thought was to refer to Chapter 10 of Mastering Perl but that seemed overkill and I'm guessing that there is a simpler solution. Is there a simpler solution?

Examples of modules that do not provide a mechanism to set proxy attributes:

WWW::WhoCallsMe

WWW::TV::Series

Was it helpful?

Solution

Ideally such modules would allow you not just to set UserAgent attributes but to entirely replace the object with one of your choice, such as a LWPx::ParanoidAgent object (not a good choice in your case).

If you are up to the task of enhancing the offensive modules to do this, kudos to you. If not, filing a bug report would be entirely appropriate.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top