Gossamer Forum
Home : General : Perl Programming :

post try again?

Quote Reply
post try again?
Using the following, I can post data to a remote script

use LWP::UserAgent;
my $ua = new LWP::UserAgent;

my $response
= $ua->post('https://www.example.com/submit.cgi',
{ param1 => 'value1',
param2 => 'value2',
});

my $content = $response->content;


However, how can I use the same concept but having backups?

For example, if example.com is down or doesn't respond in 2 seconds, go to example2.com and then if not, try example 3?