Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Re: WWW:Mechanize and Windows

by Akira71 (Scribe)
on Aug 12, 2003 at 18:31 UTC ( #283295=note: print w/replies, xml ) Need Help??

in reply to Re: WWW:Mechanize and Windows
in thread WWW:Mechanize and Windows

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(""); 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!


Replies are listed 'Best First'.
Re: WWW:Mechanize and Windows
by WhiteBird (Hermit) on Aug 13, 2003 at 00:30 UTC
    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?

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2022-06-28 06:55 GMT
Find Nodes?
    Voting Booth?
    My most frequent journeys are powered by:

    Results (90 votes). Check out past polls.