Perlbeginner1 has asked for the wisdom of the Perl Monks concerning the following question:
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_link( n=>$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->link +s}) { my $local = basename $image; print " $image...", $m->mirror($image, $local)->message, " +\n" } $m->back or die "can't go back"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: www::mechanize - the basics of a great perl module
by morgon (Priest) on Oct 25, 2010 at 23:24 UTC | |
|
Re: www::mechanize - the basics of a great perl module
by locked_user sundialsvc4 (Abbot) on Oct 26, 2010 at 02:44 UTC | |
by Perlbeginner1 (Scribe) on Oct 26, 2010 at 14:31 UTC |