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); };