Have you profiled your application (using Devel::DProf or the like)? Until you do you're just guessing at the bottleneck. Also, consider arranging the hardware to your advantage. If you can get a situation where you can read the file from one disk and write to a different disk you'll almost certainly see a big improvement in speed.