Andrew V. Makarow > Tk-TM-0.53 > Tk::TM::Try

Download:
Tk-TM-0.53.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.50   Source  

NAME ^

Tk::TM::Try - Tk Transaction Manager Error processing functions. See Tk::TM::Lib for main descriptions and principles.

SYNOPSIS ^

 use Tk::TM::Try;
 Try sub{
      TryHdr('title','stage');
      TryHdr(undef,'stage1');
     }
    ,sub{
     };
 Try(sub{...},0);
 TryDBI $dbh
       ,sub{ #transaction
        }
       ,sub{ #after rollback
        };

DESCRIPTION ^

This module implements error processing functions may be used (or not be used) in application.

VARIABLES ^

 use vars qw($ErrorDie $Error);

$Tk::TM::Try::ErrorDie

Die if error occurred. Default is false outside Try and true inside.

$Tk::TM::Try::Error

Last error occurred. Value is $@.

FUNCTIONS ^

 @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.

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{},...).

VERSION ^

"02/04/2000"

Created.

TO DO:

- Approve

- Debug and Test

AUTHOR ^

Andrew V Makarow <makarow@mail.com>, Denis E Medvedyuk <demed@mail.com>

syntax highlighting: