Re: Valid DB Handle Assertion Test

2001-08-03 Thread Michael Fowler
On Thu, Aug 02, 2001 at 09:44:00AM -0400, [EMAIL PROTECTED] wrote: > Can I test for the existence of a method without actually calling it? Yes, see my first question, and the solution to the problem. > Basically what I'm trying to do is to verify that $dbh is still a valid > handle. This soun

RE: Valid DB Handle Assertion Test

2001-08-02 Thread JCervoni
> Another approach is to wrap the disconnect in eval, which lets you capture > the error rather than having it stop your program: > > eval { $dbh->disconnect(); }; > > If $dbh is not a database handle, the relevant error message will be in $@. > > perldoc -f eval > > I think the eval method i

Re: Valid DB Handle Assertion Test

2001-08-02 Thread JCervoni
I wrote a module called DBIv that does a 'use DBI ; '. These are the functions that I defined. This module was written with the intention of providing 2 things: - a very simple interface - database independence -- Connection Functions:

Re: Valid DB Handle Assertion Test

2001-08-02 Thread JCervoni
It appears that the only kind of assertion test I could do would be to test $dbh like this if ( !defined($dbh) || $dbh eq '' ) { print "dbh is invalid\n" ; exit 1 } Jeff > Can I test for the existence of a method without actually calling it? > > Basically what I'm trying to

RE: Valid DB Handle Assertion Test

2001-08-02 Thread Bob Showalter
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Thursday, August 02, 2001 9:44 AM > To: [EMAIL PROTECTED] > Subject: Valid DB Handle Assertion Test > > > > Can I test for the existence of a method without actually calling it? I don't know. Maybe, but s