foreach(1..$number_of_cpus) { open(TEMP_CTRL,">temp_ctrl"); print TEMP_CTRL "$_"; # contains information for swap.pl close TEMP_CTRL; system("swap.pl"); # swap.pl reads temp_ctrl to know which part of the dataset to process sleep(1); } #### system(1,"swap.pl")