kixsnap has asked for the wisdom of the Perl Monks concerning the following question:
not sure what i'm doing wrong,any help is appreciated, didnt post notify_plz cuz the script doesnt even seem to get to that point.--Code-- use WWW::Mechanize; use HTTP::Cookies; use threads; $|=1; my $cookie_jar = HTTP::Cookies->new; $mech = WWW::Mechanize->new( agent => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:21.0)', cookie_jar => $cookie_jar, timeout => "15", autocheck => 0); $url = 'http://www.fwrd.com/product-military-boots/YEF3-MZ2/'; # page will default to error page if not around... $delay = 15; check(); sub check { print "[x] starting...\n"; while(1) { $resp = $mech->get($url); if((!$resp->is_success) || ($resp->request->uri =~ m/error/i)) { print "."; } else { for $sz (1..5) { $thread = threads->new( sub { notify_plz($sz) }); my $tid = $thread->tid; push (@Threads, $thread); $thread->detach(); } # we saw the page , exit exit; # end what we do if its found } sleep $delay; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: keep running out of memory, help a newbie! ( $mech->back , threads stack_size)
by beech (Parson) on Feb 14, 2017 at 01:37 UTC | |
|
Re: keep running out of memory, help a newbie!
by LanX (Saint) on Feb 14, 2017 at 00:29 UTC | |
by kixsnap (Novice) on Feb 14, 2017 at 01:20 UTC | |
by Cow1337killr (Monk) on Feb 14, 2017 at 01:52 UTC |