RE: Checking to see if a variable is a DBH

"Barlow, Ed" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase
Message-ID <[email protected]>
    i think you can just see if its a reference... ie... use the ref()
built in function.  will return "" if it is not a reference and when i
tested this,
it returned DBI::db for DBI connections to both sybase and SQL server.
 
    Ed

	-----Original Message-----
	From: [email protected]
[mailto:[email protected]] On Behalf Of Wechsler, Steven
	Sent: Friday, January 06, 2006 5:00 PM
	To: [email protected]
	Subject: Checking to see if a variable is a DBH
	
	

	Sorry, this is not a sybase-specific question, but DBI... 

	I'm writing a function that I want to be able to pass either a
Sybase server name or a DBI dbhandle; if the former, it will establish a
connection to the server; if the latter, it will use the extant
connection. Is there a straightforward way to check to see if the value
passed to the function is a DBH or not?

	Thanks, 

	Steve 


	Steve Wechsler | [email protected] 
	Sybase/SQL Server Database Administrator 
	212-846-5683 

	Picture (Metafile)MTV Networks
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.