in reply to parallelising processes

use Proc::Queue size => 8; for my $dir (@dirs) { run_back { chdir $dir and exec "foo_matrix"; }; } 1 while wait > 0;
Proc::Queue is a single file module that can be installed just dropping it in some place under your home (for instance, as /home/robert/lib/perl/Proc/Queue.pm, and then on your script use lib '/home/robert/lib/perl';)