On Mon, 20 May 2002, Matt Sergeant wrote: > if ($@ && $@->isa('Exception::DB')) { > debug "Exception: $@"; > $um->dbh->rollback; > } > > (note: if you expect all exceptions to be references like this, you had > better have a $SIG{__DIE__} handler installed to bless non-blessed > exceptions before re-throwing them
Can't you just use UNIVERSAL's ISA method directly? if (UNIVERSAL::isa($@,'Exception::DB')) { This of course might fail if you got the string "Exception::DB" or likewise back as an error message. Alternativly, check if it's blessed use Scalar::Util qw(blessed); if (blessed($@) && $@->isa('Exception::DB')) { Later. Mark. -- s'' Mark Fowler London.pm Bath.pm http://www.twoshortplanks.com/ [EMAIL PROTECTED] ';use Term'Cap;$t=Tgetent Term'Cap{};print$t->Tputs(cl);for$w(split/ +/ ){for(0..30){$|=print$t->Tgoto(cm,$_,$y)." $w";select$k,$k,$k,.03}$y+=2}