in reply to SQLite Slow insert

Try turning off autocommit.
my $dbh = DBI->connect( "dbi:SQLite:dbname=SSBHLD2.db", "", "", { RaiseError => 1, Autocommit => 0 }, ) or die $DBI::errstr;
Then add $dbh->commit(); when you finish processing the data.