in reply to Run one perl script from another?

If you have shell access to the database server, your best bet is to write a really simple perl script that just converts the original text file into another plain-text format that can be loaded directly into the table via the database server's native "import" or "load" tool.

If your text file is just a few (hundred) records, you might not notice the speed difference, but if it runs into the many thousands of records, the 10-to-1 or worse wall clock ratio (DBI inserts vs. bulk insert using the right tool) will be significant. This is equally true for mysql, oracle, postgres, etc.

Regardless of the number of records involved, you'll spend a lot less time programming, and it will be a lot easier to get right.

(If you don't have shell access, but are using mysql, it is still likely to be easier/better to upload a properly formatted version of the text file and use "LOAD DATA INFILE ...", rather than a do bunch of DBI inserts.)