The easiest way would be to process more than one file, by launching your program several times, for example through runN.
Other than that, most likely, the processing your program does within the loop is likely dwarfed by the time needed to read the next line. Adding more threads there won't speed it up.
Maybe you can reduce the time needed for IO by compressing your input files and reading them through a gzip (or bzip2) pipe:
open my $fh, "gzip -cd '$file' |" or die "Couldn't read '$file': $!"; while (<$fh>) { ... };
This shifts the time to read the data from "processing" to when the data arrives. Most likely, you won't gain much unless you need to read the data more than once. Then, maybe also creating an index file or storing the data in a database will speed things up.
Update: Fixed link to runN
In reply to Re: threading a perl script
by Corion
in thread threading a perl script
by Boetsie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |