Parallelize operations in Perl

The easiest way to parallelize an operations in Perl, is to use Prallel::ForkManager() module. Of course you can do it manually, but this way it’s very very better.

Just an example of use:

use Parallel::ForkManager;

my $MAX_PROCESSES=10;
my $pm = new Parallel::ForkManager($MAX_PROCESSES);

my $pid = $pm->start and next;
    #Operations to do in child processes.
$pm->finish;
$pm->wait_all_children;

Done, in few scripting lines we have a functionally parallel system method that use fork. The good things is that we can decide how many child the script can spawns at the same time, things quite annoying to write manually.

If you want to know how the module works, you can just see the sources, they are very readable.

Byez :)