On Thu, 8 Jul 2004 10:57:28 -0400, perl.org wrote
> 
> Looks good, except I think I noticed yesterday that if the error is actually
> connecting to the database, errstr may contain the username and 
> password, which may then be visible to the user.  Since RaiseError 
> seems to always die with errstr, I guess I can put eval around that, 
> or is there a best practice in that area?

Looks like in some contexts there should be an eval block around connect() to
ensure the password is not shown.  The pun in the output here was actually an
accident...

C:\temp>type db.pl
use strict;

use DBI;

my ${dbh} = DBI->connect( 'this', 'is', 'bad', { RaiseError => 1 } );

C:\temp>db.pl
Can't connect(this is bad HASH(0x1abf084)), no database driver specified and DBI
_DSN env var not set at C:\temp\db.pl line 5


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to