I assume you used sqlite3 tools to create the db. Try going the other way around. Create and populate the db in the Perl script, then after the script exits, see if you can read and update the db using sqlite commands.