in reply to Re: WWW::Curl pause conflict
in thread WWW::Curl pause conflict
andwhile (1) { my $url = "http://kronometrix.org/"; $http->setopt(CURLOPT_URL, $url); my $retcode = $http->perform(); ## Get the results my $response = $http->getinfo(CURLINFO_HTTP_CODE); if ($retcode == 0) { print "Ok, Status: $response\n"; } else { print "Error, Status: $response\n"; } ### Check for end last if ++$loop == $loop_max; ### Interval pause; }
The code gets stuck after 2 run samples. Always 2 . not sure why. It seems to me something between WWW::Culr (libcurl) and perl regarding alarms and timers.while (1) { my $url = "http://kronometrix.org/"; $http->setopt(CURLOPT_URL, $url); my $retcode = $http->perform(); ## Get the results my $response = $http->getinfo(CURLINFO_HTTP_CODE); if ($retcode == 0) { print "Ok, Status: $response\n"; } else { print "Error, Status: $response\n"; } ### Check for end last if ++$loop == $loop_max; ### Interval sleep; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: WWW::Curl pause conflict
by Anonymous Monk on Sep 21, 2015 at 07:00 UTC | |
by krmx (Novice) on Sep 21, 2015 at 07:17 UTC |