Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^4: Combining Ffile:fetch with MySQL

by afoken (Chancellor)
on Jul 24, 2022 at 10:13 UTC ( [id://11145683]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Combining Ffile:fetch with MySQL
in thread Combining Ffile:fetch with MySQL

However, on the subsequent 4 $dbh->do statements you make no such tests.

... and with a little bit of RTFM, none of those tests is needed. Change

my $dbh = DBI->connect($dsn, $user, $password) or die "Couldn't connect to database: " . DBI->errstr;

to

my $dbh = DBI->connect($dsn, $user, $password, { RaiseError => 1, Prin +tError => 0 }) or die "Couldn't connect to database: " . DBI->errstr;

and DBI will automatically check for errors, no manual checks needed.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 22:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found