Try something like this (not the best example,
I find SOAP::Lite quite powerful, but difficult to
understand at the same time - untested code).
my $soap;
my $tries = 0;
my $success = 0;
while ($tries < 10 && !$success) {
$success = 1; # set it to one, on fault, we'll set it to 0
$soap = SOAP::Lite
-> on_fault(sub { $success = 0; }),
-> uri('http...ect');
++$tries;
}
Update: fixed typo (thanks ptum) |