The module DBD::DBM supports BerkeleyDB. That means that you can use DBI to select from any database source (including CSV and MySQL) and insert into a BerkeleyDB database. You could also just use DBI's selectall_hashref() to load the data source into a hash and then tie that to your BerkeleyDB.