- or download this
sub wrapper {
eval {
...
}
return 1; #returns true if we should retry
}
- or download this
use constant RETRIES => 3;
for (1..RETRIES) { last if wrapper() }
- or download this
use constant RETRIES => 3;
our $give_up = 0;
...
}
die ('Tried '.RETRIES.' times without success. Giving up.')
if $give_up;