in reply to Re: Always Looping
in thread Always Looping
I also changed the criteria for success to check for 'definedness', because the LWP::Simple::get() function will explictly return undef if it fails.use strict; use LWP::Simple; my $data = ""; my $try_count = 0; while ($try_count++ < 5) { $data = LWP::Simple::get('http://somedomain/'); last if defined $data; print "were is this file?\n"; sleep(5); };
|
|---|