While not an answer to multithreading, you might look into some other performance improvements as well. I don't know the format of your source file, but there might be some things to look for:
- Do you need to split/,/ all the way or do you only need the first few columns? Limiting the splitting might speed things up.
- Are some of the things you check for by regex actually on a fixed position in the string? substr() might be faster.
- Are you really limited by the CPU? You might be slowed down by IO. Putting source and destination on different drives might help.
- The statement print EQFILE ",,eq_".$arrn1.",1,\n" runs a useless string concatenation. Use commas instead of dots between string parts. Also, the first fixed string can use single quotes, this removes the need to run the "check if string contains variables that we need to replace" part of string generation.
"For me, programming in Perl is like my cooking. The result may not always taste nice, but it's quick, painless and it get's food on the table."