Advertisement
Advertisement
| 08.04.2008 at 04:30PM PDT, ID: 23620769 | Points: 250 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: |
#########################
# Start of timeout #####
use DBIx::Timeout;
# run code() for a maximum of 1 second, doing work with $dbh
local our $ok = DBIx::Timeout->call_with_timeout(
dbh => $dbh,
code => sub {
$sth->execute( );
},
timeout => 1
);
# handle the result
if (!$ok) {
die "You ran out of time!";
}
#########################
# End of timeout ########
|