in reply to HOW TO CREATE A DATABASE FILE WITH FIELDS IN RECORDS

The other replies to this node are about creating a database engine
If you just want to create a new database within an existing database engine (which is how I - probably incorrectly - read this node) is not too hard.
use DBI; my $dbh = DBI->connect("DBI:enginename"); $dbh->do("CREATE DATABASE foo"); $dbh->do("CREATE TABLE foo.blah (id INT, data BLOB)"); # then proceed with inserting and selecting
You may or may not be able to use all this syntax depending on database engine, but you could probably implement the funtionality non-portably with $dbh->func('something'); or stored procedures. Read DBI docs together with docs for the driver used eg..DBD::Oracle