Beefy Boxes and Bandwidth Generously Provided by pair Networks
DiBona Welcome to the Monastery  Re^2: getting a while loop to
terminate  by Datz_cozee75 (Acolyte) on Apr 17, 2012 at
16:41 UTC ( #965532=note: print w/ replies, xml ) Need Help??
in reply to Re: getting a while loop to terminate in thread
getting a while loop to terminate  Yay! first taste of
victory....  $ perl site_13 $ cd site_13 $ ls image_1 image_2
image_3 ... $ cd .. $ cat #!/usr/bin/perl -w use strict; use
WWW::Mechanize; use LWP::Simple; my $domain = ''; my $m =
WWW::Mechanize->new; $m->get( $domain); my $counter = 0; my $dir
= &dirname; my @list = $m->images(); for my $img (@list) { my
$url = $img->url_abs(); $counter++; my $filename = "$dir".
"/image_". "$counter"; getstore($url,$filename) or die "Can't
download '$url': $@\n"; } sub dirname { my $word = "site"; my
$counter = 1; my $flag = 1; while ($flag) { my $name = "$word" .
"_" . "$counter"; if ( -d $name) { $counter++; next; } else {
mkdir $name, 0755 or warn "Cannot make dir $na