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 Sub::Attempts 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 Attribute::Handlers does.
Bugs should be reported to me via the CPAN RT system. http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Attribute::Attempts.
Sub::Attempts, Attempt
To install Attempt, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Attempt
CPAN shell
perl -MCPAN -e shell install Attempt
For more information on module installation, please visit the detailed CPAN module installation guide.