in reply to Error messages from DBI
Look closer at the example in the DBI documentation. Your connect() would probably work this way:
my $dbh = DBI->connect($dsn,$user,$password, { RaiseError => 1, AutoCommit => 0 }) || die "Database connection failed: $DBI::errstr";
The last argument is a hash reference. If you're not familiar with references, have a look at perlreftut and perlref. After that, maybe References quick reference.
Update: Also, since you're using RaiseError, you don't need to die explicitly. DBI will do that for you if there's a problem.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Error messages from DBI (\%attr)
by nbierman (Novice) on Jun 12, 2008 at 17:00 UTC | |
by radiantmatrix (Parson) on Jun 12, 2008 at 20:37 UTC |