in reply to how to create a database in perl
You control that via the dsn; see the DBD::mysql docs (second line of the synopsis):
$dsn = "DBI:mysql:database=$database;host=$hostname;port=$port";
Specifically: the 'database=$database;' part.
The part of the dsn after 'dbi:<driver>:' is given as a whole to the specific database driver; what the driver expects is specific to that driver. For example, in the case of postgresql database driver DBD::Pg, the database can be given with either 'database', 'dbname', or 'db'.