dietmar has asked for the wisdom of the Perl Monks concerning the following question:

Hi,


It seems to be a classic issue: I ran into problems when trying to install WWW::Mechanize. I use Ubuntu and typing
# cpan WWW::Mechanize

produced the following

CPAN: Storable loaded ok (v2.21) Going to read '/root/.cpan/Metadata' Database was generated on Wed, 08 Sep 2010 05:32:19 GMT CPAN: YAML loaded ok (v0.66) Going to read 5 yaml files from /root/.cpan/build/ CPAN: Time::HiRes loaded ok (v1.9721) DONE Restored the state of none (in 0.2265 secs) Running install for module 'WWW::Mechanize' Running make for P/PE/PETDANCE/WWW-Mechanize-1.64.tar.gz Has already been unwrapped into directory /root/.cpan/build/WWW-Mech +anize-1.64-_fbjEy '/usr/bin/perl Makefile.PL INSTALLDIRS=site' returned status 512, wo +n't make Running make test Make had some problems, won't test Running make install Make had some problems, won't install


I checked many other threads on installation problems around WWW::Mechanize. Any help would be greatly appreciated.


Kind regards,


Dietmar

Replies are listed 'Best First'.
Re: Installation of WWW::Mechanize Again
by Corion (Patriarch) on Sep 08, 2010 at 07:45 UTC

    If you're using the (Ubuntu) stock Perl interpreter, you want to install Perl modules through apt-get (or whatever other package tool is en vogue on Ubuntu currently). The package is libwww-mechanize-perl.

    Don't install modules into the system Perl. Always use the system package manager. If you want to use cpan to install (more current) versions from CPAN, compile and install your own Perl or use local::lib. Neither is hard.

      Echoing Corion's advice.

      On a Debian based system you should

      • apt-cache search $Package::Name to find out the name of the package containing the library
      • sudo apt-get install $package_name-from_above
      Taking this approach ensures you don't mangle your system Perl and also has the advantage of installing all dependencies.

      print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."
Re: Installation of WWW::Mechanize Again
by JavaFan (Canon) on Sep 08, 2010 at 09:59 UTC
    So, what happens if you actually run:
    $ cd /root/.cpan/build/WWW-Mechanize-1.64-_fbjEy $ /usr/bin/perl Makefile.PL INSTALLDIRS=site
    The output may contain valuable (and obvious) clues.
      Hi,

      thanks for all answers - it worked :)

      Running

      > cd /root/.cpan/build/WWW-Mechanize-1.64-_fbjEy > /usr/bin/perl Makefile.PL INSTALLDIRS=site

      ... produced a gentler reminder that firstly I need to have SSL support ...

      It looks like you don't have SSL capability (like IO::Socket::SSL) ins +talled. You will not be able to process https:// URLs correctly.

      To get the SSL capability I installed

      > sudo apt-get install libhttp-daemon-ssl-perl

      With this requirement out of the way I could then address the installation of WWW::Mechanize proper

      > apt-cache search WWW::Mechanize > sudo apt-get install libwww-mechanize-perl

      Finally,  instmodsh listed the installed Perl modules with WWW::Mechanize being one of them.

      Thanks!!

      Dietmar

Re: Installation of WWW::Mechanize Again
by ikegami (Patriarch) on Sep 08, 2010 at 16:06 UTC

    From scratch including downloading the tarball:

    cpan -f -g WWW::Mechanize cpan WWW::Mechanize

    From scratch using the previously downloaded tarball:

    cpan -f -m WWW::Mechanize cpan WWW::Mechanize
      Hi folks,

      On top of WWW::Mechanize I want to install WWW::Mechanize::Frames. So I downloaded the tarball, unpacked it and ran

      perl Makefile.PL make make test make install

      The first three steps looked all right. Unfortunately, the fourth step one did not ...

      # tar -zxvf WWW-Mechanize-Frames-0.03.tar.gz WWW-Mechanize-Frames-0.03/ WWW-Mechanize-Frames-0.03/lib/ WWW-Mechanize-Frames-0.03/lib/WWW/ WWW-Mechanize-Frames-0.03/lib/WWW/Mechanize/ WWW-Mechanize-Frames-0.03/lib/WWW/Mechanize/Frames.pm WWW-Mechanize-Frames-0.03/t/ WWW-Mechanize-Frames-0.03/t/WWW-Mechanize-Frames.t WWW-Mechanize-Frames-0.03/Changes WWW-Mechanize-Frames-0.03/MANIFEST WWW-Mechanize-Frames-0.03/Makefile.PL WWW-Mechanize-Frames-0.03/META.yml WWW-Mechanize-Frames-0.03/README root@vps-848-442250:/usr/local/src/scraper# cd WWW-Mechanize-Frames-0. +03 root@vps-848-442250:/usr/local/src/IRD/scraper/WWW-Mechanize-Frames-0. +03# perl Makefile.PL Checking if your kit is complete... Looks good Writing Makefile for WWW::Mechanize::Frames root@vps-848-442250:/usr/local/src/IRD/scraper/WWW-Mechanize-Frames-0. +03# make cp lib/WWW/Mechanize/Frames.pm blib/lib/WWW/Mechanize/Frames.pm Manifying blib/man3/WWW::Mechanize::Frames.3pm root@vps-848-442250:/usr/local/src/IRD/scraper/WWW-Mechanize-Frames-0. +03# make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/WWW-Mechanize-Frames.t .. ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.01 usr 0.00 sys + 0.10 cusr + 0.01 csys = 0.12 CPU) Result: PASS root@vps-848-442250:/usr/local/src/IRD/scraper/WWW-Mechanize-Frames-0. +03# make install Not a HASH reference at /usr/share/perl/5.10/ExtUtils/Install.pm line +557. make: *** [pure_site_install] Error 2 root@vps-848-442250:/usr/local/src/IRD/scraper/WWW-Mechanize-Frames-0. +03#

      My understanding of the error message is that something is wrong with line 557 of Install.pm.

      my(%from_to) = %$from_to;

      This line is part of the subroutine install which is flagged as #XXX OS-SPECIFIC.

      Suggestions on this issue are greatly appreciated - Thank you!

      Kind regards

      Dietmar

Re: Installation of WWW::Mechanize Again
by suhailck (Friar) on Sep 08, 2010 at 07:45 UTC