I've managed to do it this way:
use DBI;
$username = 'root';$password = '';$database = 'tina'; $hostname = '';
$dbh = DBI->connect("dbi:mysql:database=$database;" .
"host=$hostname;port=3306", $username, ) or $result=`mysqladmin -u root create tina`;
Basically, it's doing what I wanted, but...