perlpreben has asked for the wisdom of the Perl Monks concerning the following question:
Hi
I've always had a hard time figuring out how you pass values to a module, when your using a module that depend on others that you need to tincker with.
An example is now when im playing around with WWW::RobotRules.
This module uses LWP::Simple for its requests (i think), and I want to pass a timeout => '2' to LWP::Simple, but all I have in my code is things evolving around the main module, robotrules.
Example;
Just to make it clear, I know how to read the docs for LWP::Simple ;), ... its jut a matter of how to I access this layer, since robotrules has precidence.
I've always had a hard time figuring out how you pass values to a module, when your using a module that depend on others that you need to tincker with.
An example is now when im playing around with WWW::RobotRules.
This module uses LWP::Simple for its requests (i think), and I want to pass a timeout => '2' to LWP::Simple, but all I have in my code is things evolving around the main module, robotrules.
Example;
require WWW::RobotRules; my $user_agent = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)"; my $robotsrules = new WWW::RobotRules '$user_agent'; ..... $robotsrules->parse($url, $robots_txt); if($robotsrules->allowed($url)){ }
Just to make it clear, I know how to read the docs for LWP::Simple ;), ... its jut a matter of how to I access this layer, since robotrules has precidence.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Passing timeout params through WWW::RobotRules
by almut (Canon) on Apr 17, 2010 at 15:49 UTC | |
Re: Passing timeout params through WWW::RobotRules
by trwww (Priest) on Apr 17, 2010 at 16:12 UTC | |
by perlpreben (Beadle) on Apr 17, 2010 at 18:03 UTC |
Back to
Seekers of Perl Wisdom