http://www.perlmonks.org?node_id=362651

js1 has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I have a script to parse a proxy log (node 362548) and I'm planning to use DBI to update a mysql database when the sql insert command reaches 2MB (node 362109).

In order to run this script as quickly as possible would I be right to run the database update whilst I carry on parsing the log? I presume I need some sort of thread to do this (not something I've done before in perl).

Could someone tell me if I'm on the right track here and if not point me in the right direction? If threads are the way to go where would be the best place to start?

Also this script will run on a machine with 2 cpus. Will the threading enable it to use both cpu's?

Thanks a lot,

js.

Edit by BazB: changed href links into Perlmonks node links.