Perlist at blogspot
2014/10/24
Try::Tiny::Retry
#!/usr/bin/env perl
use Try::Tiny::Retry;
my $current = 1;
sub get_next {
return $current++;
}
retry {
print get_next() . "\n" and die;
}
catch {
print "catched\n";
}
finally {
print "finally\n";
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment