http://www.perlmonks.org?node_id=1022092


in reply to Re^3: MySQL Table adding with Perl
in thread MySQL Table adding with Perl

If you use the following to connect to the database, DBI will tell you more about where things (maybe) go wrong:

my $connect = DBI->connect( "dbi:mysql:database=Champ;host=localhost", 'root','pass', { RaiseError => 1 }, );

This saves you adding the error checking in every situation.

A bit more advice - I like to read passwords from a separate file, or from %ENV or anywhere else. That way, I can't inadverently post the database password when posting (or printing) my script.