Arunbear has asked for the wisdom of the Perl Monks concerning the following question:
Say you already have a sub which creates a database handle e.g.
, is there a way to use that when setting up Class::DBI classes? thanks.sub connect { my $dbh = DBI->connect( $dsn, $user, $passwd, {PrintError => 0} ) or Exception::Database->throw($DBI::errstr); $dbh->{HandleError} = sub { Exception::Database->throw($_[0]) }; return $dbh; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Setting up Class::DBI classes with existing $dbh
by merlyn (Sage) on Dec 09, 2003 at 21:44 UTC | |
|
Re: Setting up Class::DBI classes with existing $dbh
by hanenkamp (Pilgrim) on Dec 09, 2003 at 21:46 UTC | |
|
Re: Setting up Class::DBI classes with existing $dbh
by jeffa (Bishop) on Dec 09, 2003 at 21:48 UTC | |
|
Re: Setting up Class::DBI classes with existing $dbh
by perrin (Chancellor) on Dec 10, 2003 at 17:31 UTC |