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

I'm trying to get a simple script of WWW-Mechanize to work under a Windows environment.

ActivePerl is present with ppm (version2) and ppm3 (version3). I've managed to install the WWW-Mehcanizer version, although it seems to be a very old version - 0.48 vs the cpan download - 1.14. How do I resolve this issue?
Moreover, with the installed 0.48 version of WWW-Mechanize.
I'm trying to achieve the following simple code:

#!/usr/bin/perl use WWW::Mechanize; my $url = "http://172.68.1.23"; my $mech = WWW::Mechanize->new(); $mech->get($url); my $title = $mech->title; print "$title \n";
$url is an existing website in our LAN.
Nothing happens though... No output whatsoever.


Any help is appreciated.
Thanks.

Replies are listed 'Best First'.
Re: WWW-Mechanizer under windows
by davidrw (Prior) on Oct 26, 2005 at 12:54 UTC
    You can find a 1.14 ppm of WWW::Mechanize over at the Winnipeg Repository at http://theoryx5.uwinnipeg.ca/ppms/ ... to install directly from there, run ppm3 and then
    install http://theoryx5.uwinnipeg.ca/ppms/WWW-Mechanize.ppd
    As for not getting a title, are you sure the page has one (and is proper html)? Here's a few things you can add to try and determine what's happening:
    $mech->get($url); warn "Success: " . $mech->success ? 'OK' : 'BAD'; warn "Code: " . $mech->status; warn "Actual content: " . $mech->content;
Re: WWW-Mechanizer under windows
by mulander (Monk) on Oct 26, 2005 at 12:49 UTC
    You can try searching the repositories from PPM::Repositories ( if you haven't done that yet ).
    Or you can install cygwin and install/compile the newest version of it from CPAN shell.
Re: WWW-Mechanizer under windows
by liri (Acolyte) on Oct 26, 2005 at 14:21 UTC

    Thanks for the comments guys.

    I did remove the 0.48 package and installed the new one (1.14) (By the way, is there a list of current repositories and how to add them to ppm?)

    I'm still unable to make use of the Mechanize for some reason. A telnet on port 80 works fine.


    C:\Perl\projects>perl test.pl OK at test.pl line 30. Code: 500 at test.pl line 31. Actual content: 500 Server closed connection without sending any data +back C:\Perl\projects>
    Any ideas? Thanks.

      When you telneted to port 80 did you try issue a

      GET /index.html HTTP/1.0
      following by two presses of the return key? Gettting a 500 Server closed connection without sending any data

      back is consistent with telnet ipaddress 80 connecting but not sending any data.


        Right.
        It seemed like the problem was that I specified a
        $mech->get("http://10.0.1.1") instead of
        $mech->get("http://10.0.1.1/index.htm")
        which is weird because on linux it worked just fine without the index.htm suffix...