Attribute::Attempts - attribute version of Attempt::Sub
use Attribute::Attempts;
# alter db will try three times before failing sub alter_db : attempts(tries => 3, delay => 2) { my $dbh = DBI->connect("DBD::Mysql:foo", "mark", "opensaysme") or die "Can't connect to database"; $dbh->{RaiseException} = 1; $dbh->do("alter table items change pie pies int(10)"); }
It's an attribute version of Sub::Attempts. See the Sub::Attempts manpage for information on how the attributes work.
Written by Mark Fowler <mark@twoshortplanks.com>
Copryright Mark Fowler 2003. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
As far as I know, works on any platform the Attribute::Handlers manpage does.
Bugs should be reported to me via the CPAN RT system. http://rt.cpan.org/NoAuth/ReportBug.html.