1 2 3 4 5 6 7 8
my $host1 = '198.99.8.7'; my $dsn1 = "dbi:mysql:database=db998877;host=$host1;port=3306"; my $dbh = DBI->connect($dsn1, $username1, $passw1); ... ... my $host2 = '118.111.228.99'; my $dsn2 = 'dbi:mysql:database=database0817;host=$host2;port=3306'; my $dbh2 = DBI->connect($dsn2, $username2, $passw2);