Perl – Trouble With CPAN Module

perlscraperwww-mechanize

I've tried to install the WWW::Mechanize module with

'cpan WWW::Mechanize'

I get no errors on the 'use WWW::Mechanize' line which means its finding the files, but upon trying to instantiate it with:

$m = WWW::Mechanize->new();

I get the following problem:

Can't locate HTTP/Config.pm in @INC (@INC contains: /Library/Perl/Updates/5.10.0/darwin- thread-multi-2level /Library/Perl/Updates/5.10.0 /System/Library/Perl/5.10.0/darwin-thread-multi-2level /System/Library/Perl/5.10.0 /Library/Perl/5.10.0/darwin-thread-multi-2level /Library/Perl/5.10.0 /Network/Library/Perl/5.10.0/darwin-thread-multi-2level /Network/Library/Perl/5.10.0 /Network/Library/Perl /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level /System/Library/Perl/Extras/5.10.0 .) at /Library/Perl/5.10.0/LWP/UserAgent.pm line 746.

I'm not exactly sure what is going on. I feel like I have all the neccessary dependencies, but I can't seem to find what this particular error means.

My script is empty besides the previously mentioned lines and

use strict;
use warnings;

Has anyone run into this?

Best Answer

try installing it with the following command (from the shell):

perl -MCPAN -e 'install WWW::Mechanize'

follow the installation process, and answer 'Y' where needed.

Related Topic