On Wed, Jun 18, 2003 at 09:18:42AM -0400, Joel Gwynn wrote:
>  $dbh =
> DBI->connect("dbi:$$config{dbi}:PROVIDER=$$config{provider};SERVER=$$con
> fig{dbserver};UID=$$config{uid};PWD=$$config{password};DATABASE=$$config
> {database}") || return "Couldn't connect.";
> 
> The problem is not so much that I can't connect, the problem is that if
> I can't, I don't want to return the db credentials to the browser.  How
> can I turn this off?

1. The old fashioned and reliable way is to wrap the connect(...) call
   inside an eval and test for errors outside.

    eval {
        DBI->connect(...);
    };

    if ($@){
        .....
    }

2. DBI v1.32 also has the HandleError method which may do what you want.
   I have never used it, had never heard of it until 5 minutes ago, and
   don't know how long it's been there. But it *is* in the docs, so
   there you have it.

-Gyepi
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to