in reply to running multiple system commands in parallel

You could use the code below, which you would use to call the multiple scripts, each with the command that you'd like output from. Have the script that is being called print the output to STDOUT, and the script below will then print the output (or you can modify it to do whatever you need with the output).
#!/usr/bin/perl use strict; use warnings; use Getopt::Long; use Parallel::ForkManager; use Benchmark; use File::Basename; my $thisScript = basename($0); my ($infile,$scriptName); sub usage { print <<EOF; USAGE: $thisScript -infile yourFile -script scriptToInvoke EOF } my %optctl=(); usage if (!GetOptions(\%optctl, "infile=s", "script=s", "<>", \&usage) ); if (exists($optctl{"infile"}) && exists($optctl{"script"})) { $infile = $optctl{"infile"}; $script = $optctl{"script"}; } else { exit usage; } # Use for Expect debugging open INPUT,"<$infile" or die "Could not open input ($!)\n"; my @input=<INPUT>; close INPUT; my $start = new Benchmark; my ($pm,$masterList); my $maxProbes = 80; # set this to one to do one at a time $pm = new Parallel::ForkManager($maxProbes); foreach my $line (@input) { chomp $line; $pm->start and next; my $stdout = `$script \"$line\"`; chomp $stdout; print "$stdout\n"; $pm->finish; } $pm->wait_all_children; my $end = new Benchmark; my $diff = timediff($end,$start); print "Time taken was ", timestr($diff, 'all'), " seconds\n";