http://www.perlmonks.org?node_id=860573

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I would like to be able to have the option to retry when I am running the code below. Is there an option in HTTP::Request::Common to do that? Also, is there a way to adjust the response time of the module so that it will wait for example, 5 seconds, before giving up?
#!/usr/bin/perl use warnings; use strict; use HTTP::Request::Common; use LWP::UserAgent; my $ua = LWP::UserAgent->new( cookie_jar => '' ); my $request = HTTP::Request->new( 'GET', 'http://www.google.com' ); my $result = $ua->request( $request ); print $result->status_line;