the DBI module allows you to specify a host machine in the DBI::connect() method. With Mysql, the first param to connect includes the options host, such as
...
my $db_handle= DBI->connect("DBI:mysql:my_table:10.100.100.100", "
+user", "pass", ...)
or die;
...