Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

(elbie): checking whether DBI connection made

by elbie (Curate)
on Aug 16, 2001 at 17:57 UTC ( [id://105375]=note: print w/replies, xml ) Need Help??


in reply to checking whether DBI connection made

There have been a lot of good suggestions so far. I just wanted to add my .16th of a bit (as in shave-and-a-haircut bits, not the memory bits).

If a DBI->connect fails, there will be an error string set in DBI::errstr. This is analogous to the $dbh->errstr when you have an open db handle. The perldoc on DBI will have more info.

e.g.

my $dbh = DBI->connect('DBI:stack_of_papers_on_my_desk', 'user', 'pw') or die DBI::errstr;

elbieelbieelbie

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://105375]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-25 07:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found