use strict; use warnings; #### sub open_dbi { # Declare and initialize variables my $host = '192.168.1.3'; my $db = 'd60380940'; my $db_user = 'root'; my $db_password = 'root'; # Connect to the requested server # my $dbh = DBI->connect("dbi:mysql:database=$db;host=$host", $db_user, $db_password, {RaiseError => 0, PrintError => 0} ) or err_trap("Cannot connect to the database"); my $dbh = DBI->connect("dbi:ODBC:database=$db;host=$host", $db_user, $db_password, {RaiseError => 0, PrintError => 0} ) or err_trap("Cannot connect to the database"); return $dbh; }