#!/usr/bin/perl use strict; my @mch = ('compute-0-0','compute-0-1'); my @children; for (my $i = 0;$i<=1;$i++){ my $pid = fork(); if ($pid){ push @children, $pid; } elsif ($pid == 0){ print $$ . "\n"; print "$mch[$i] \n"; exec("ssh $mch[$i] ./sleep.pl") || die "cannot execute process\n"; exit; } else{ die "could not fork! \n"; } } foreach (@children){ waitpid($_,0); } sleep.pl #!/usr/bin/perl use strict; for (1..10000000){ my $rez = 1; for (1..500){ $rez *=$_; } }