Unfortunately, this is not a script writing service. Although, we will be happy to help you troubleshoot the code that you are working on. :-|)
For extracting text from a file, there are a number of ways you can do that. Since we don't know what the text looks like and what you are trying to extract, advice is minimal at this time. For inserting data into a database, you will probably want to read up on the
DBI module on CPAN. That is the best way to interact with a database in Perl.
Why don't you do what you can and write your program. Then, when you get stuck, come back and post your code, letting us know where you are stuck. We can then give you the nudge you need or help you troubleshoot your issue.
Regards,
Jeff