Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: WWW:Mechanize and Windows

by jdtoronto (Prior)
on Aug 12, 2003 at 17:05 UTC ( [id://283267]=note: print w/replies, xml ) Need Help??


in reply to WWW:Mechanize and Windows

Hi,

I haven't looked into this particular problem, but every time I have had those errors it is due to a badly formed reference to the module in my code.

It might help if we could see the code that caused the error in the first place.

....john

Replies are listed 'Best First'.
Re: Re: WWW:Mechanize and Windows
by Akira71 (Scribe) on Aug 12, 2003 at 18:31 UTC
    Hello John, Well all the examples cause the problem from the example.pod file. Here is the shortest one, written by Randal himself. I was running this code to test the module out and that is when I ran into the problem. In other words, I have not even gotten to my own code yet. I have also been unsuccesfull in getting the latest version of this module to install which is why I went to the prior version.
    use strict; $|++; use WWW::Mechanize; use File::Basename; my $m = WWW::Mechanize->new; $m->get("http://www.despair.com/indem.html"); my @top_links = @{$m->links}; for my $top_link_num (0..$#top_links) { next unless $top_links[$top_link_num][0] =~ /^http:/; $m->follow($top_link_num) or die "can't follow $top_link_num"; print $m->uri, "\n"; for my $image (grep m{^http://store4}, map $_->[0], @{$m->links}) { my $local = basename $image; print " $image...", $m->mirror($image, $local)->message, "\n" } $m->back or die "can't go back"; }

    This is the very line that causes it:
    my $m = WWW::Mechanize->new;

    Well any help is always appreciated. Thank you very much!

    Akira
      Using Windows 2000, ActiveState perl v5.6.1 and WWW::Mechanize (version 0.43)-- I cut and pasted your code and it runs perfectly on my system. So, perhaps the problem is in your version of Mechanize, or perhaps you're missing something else on your system. When I run the code through my debugger, it does tap into LWP::UserAgent. Could you have a problem there? (Seems unlikely, but leave no stone unturned.)

      I know this isn't much help. But don't give up hope, the code can work.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://283267]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-19 21:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found