Tk::TM::Try - Tk Transaction Manager Error processing functions. See Tk::TM::Lib for main descriptions and principles.
use Tk::TM::Try; Try sub{ TryHdr('title','stage'); TryHdr(undef,'stage1'); } ,sub{ }; Try(sub{...},0); TryDBI $dbh ,sub{ #transaction } ,sub{ #after rollback };
This module implements error processing functions may be used (or not be used) in application.
use vars qw($ErrorDie $Error);
$Tk::TM::Try::ErrorDie
Die if error occurred. Default is false outside Try and true inside.
Try
$Tk::TM::Try::Error
Last error occurred. Value is $@.
@EXPORT = qw(Try(@) TryDBI(@) TryHdr);
Try ( eval {...}, default ) -> result
Try ( eval {...}, \&catch ) -> result
Try ( sub {...}, ... ) -> result
Try-Catch construction. Function Try returns result of eval on success. If error occurred (determined by $@), it returns default value or result of catch evaluation.
TryDBI ( ?dbh, sub {...}, default ) -> result
TryDBI ( ?dbh, sub {...}, \&catch ) -> result
Try-Catch construction for database transaction. Default database handle may be given from current data object or $Tk::TM::Common::DBH. $dbh->{AutoCommit} and $dbh->{RaiseError} are used inside TryDBI.
TryDBI
TryHdr (subject, stage)
TryHdr (undef, stage)
Declare title and/or stage name of transaction to insert into $@ inside Try. May be used only inside Try(sub{},...).
Created.
TO DO:
- Approve
- Debug and Test
Andrew V Makarow <makarow@mail.com>, Denis E Medvedyuk <demed@mail.com>
2 POD Errors
The following errors were encountered while parsing the POD:
You can't have =items (as at line 51) unless the first thing after the =over is an =item
You can't have =items (as at line 74) unless the first thing after the =over is an =item
To install Tk::TM::Try, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tk::TM::Try
CPAN shell
perl -MCPAN -e shell install Tk::TM::Try
For more information on module installation, please visit the detailed CPAN module installation guide.