in reply to Re: WWW::Mechanize 1.04 for Windows
in thread WWW::Mechanize 1.04 for Windows

That'S what I did. But when I run a programme (see below) that uses the uri-routine, I get the following response: "Can't locate object method uri via WWW::Mechanize::Link". Furthermore, 9 tests and 14 subtests of nmake test were skipped.
#!/usr/bin/perl -w use strict; use WWW::Mechanize; my $agent = WWW::Mechanize->new(); $agent->get("http://europa.eu.int/prelex/rech_avancee.cfm?CL=en"); die "Can't even get the home page: ", $agent->response->status_line un +less $agent->success; $agent->form(2); $agent->field("clef2", "1999"); $agent->field("clef1", 'COM'); $agent->field("nbr_element", '99'); $agent->click(); my $input=$agent->content(); my @links = grep { $_->uri =~ m!liste_resultats! } $agent->links; foreach my $link (@links) { print "Retrieving $link\n"; $agent->follow( $link ); print $agent->content; $agent->back; };

Replies are listed 'Best First'.
Re^3: WWW::Mechanize 1.04 for Windows
by ikegami (Patriarch) on Nov 26, 2004 at 19:37 UTC

    And a very appropriate response it is, seeing as how WWW::Mechanize::Link has methods named url and URI, but none named uri.

    WWW::Mechanize::Link pod

Re^3: WWW::Mechanize 1.04 for Windows
by bart (Canon) on Nov 28, 2004 at 03:25 UTC
    Why do you think installation of WWW::Mechanize failed? The error you encounter is a runtime error at line 13 of your script. That implies that all the calls to that module above it, have actually succeeded — or at least, not made the module barf. Heck, even the $agent->links call, on the right of your grep block, must have returned some values or you wouldn't have gotten this far.

    And ikegami pinpointed the cause of your problem. A non-existing method name, that's a runtime error, as methods can even be created (by AUTOLOAD) on the fly.

    Conclusion: unless the exact same script works on another computer, and I sincerely doubt that, the module most likely will have been properly installed.