Hi. I am trying to write a simple robot that reads urls from a text file. The source is listed below. I am getting an error that says:
LWP::RobotUA=HASH(0x83d7994) GET 1 ...Can't locate object method "host" via package "URI::_generic" (perhaps you forgot to load "URI::_generic"?) at /usr/lib/perl5/site_perl/5.6.1/WWW/RobotRules.pm line 187, <IN> line 2. I have search Google far and wide, and have found other people with this problem, but no solution. I am running RedHat 7.2 and perl 5.6.1. Most of my perl modules are installed via RPM, but I manually installed the Robot package (WWW-Robot-0.022). Any ideas? I am stumped. Thanks for your help. Ken Munro ------------------------PROGRAM OUTPUT ----------------------------------- [ken@mainsail robot]$ ./dory.pl http://www.mainsail.ca/ http://www.yogastudio.ns.ca/ Check that the required attributes are set ... Traversal type set to depth Check that the required hooks are set ... 1 LWP::RobotUA=HASH(0x83d7994) GET 1 ...Can't locate object method "host" via package "URI::_generic" (perhaps you forgot to load "URI::_generic"?) at /usr/lib/perl5/site_perl/5.6.1/WWW/RobotRules.pm line 187, <IN> line 2. [ken@mainsail robot]$ ----------------------PROGRAM SOURCE CODE -------------------------------- #!/usr/bin/perl use WWW::Robot; use strict; #use Test::Tes; my $url_file = "urls.txt"; my @urls; my $robot = new WWW::Robot( 'NAME' => 'Dory', 'VERSION' => '0.1', 'EMAIL' => '[EMAIL PROTECTED]', 'VERBOSE' => '1'); $robot->addHook("follow-url-test", \&dory_follow_url_test); $robot->addHook("invoke-on-followed-url", \&dory_invoke_on_followed_url); open IN, $url_file; while (<IN>) { push @urls, chomp($_); print "$_\n"; } $robot->run(@urls); sub dory_follow_url_test() { my $robot = shift; my $hook = shift; return(1); } sub dory_invoke_on_followed_url() { my($robot, $hook_name, $url) = @_; # print "$url->address\n"; } ------------------------ INPUT FILE urls.txt -------------------------- http://www.mainsail.ca/ http://www.yogastudio.ns.ca/ -------------------- PERL RPMS INSTALLED ---------------------- perl-Parse-Yapp-1.05-15 perl-Digest-MD5-2.16-15 perl-XML-Grove-0.46alpha-11 perl-DBI-1.21-1 perl-XML-Parser-2.30-15 perl-DBD-MySQL-1.2219-6 perl-HTML-Tagset-3.03-14 perl-HTML-Parser-3.26-2 perl-Storable-1.0.14-15 perl-libxml-perl-0.07-14 mod_perl-1.26-5 perl-DateManip-5.40-15 perl-URI-1.17-16 perl-XML-Twig-2.02-9 groff-perl-1.17.2-12 perl-DB_File-1.75-26.72.3 perl-XML-Encoding-1.01-9 perl-CGI-2.752-34.99.6 perl-5.6.1-34.99.6 perl-NDBM_File-1.75-34.99.6 perl-MIME-Base64-2.12-14 perl-XML-Dumper-0.4-12 perl-libnet-1.0901-17 perl-CPAN-1.59_54-34.99.6
