#!C:\Perl\bin\perl.exe use warnings; use strict; my @drive_dir = ('perl /a/dir_file_create.txt' , 'perl /b/dir_file_create.txt', 'perl /c/dir_file_create.txt'); # Create a new process my $proc_cmd = fork(); if (!defined $proc_cmd) { die "Unable to fork: $!"; } elsif ($proc_cmd == 0){ # Child foreach my $create (@drive_dir){ exec ("$create"); } die "Unable to exec: $!" if $!; } else { # Parent print "\nThe process id is : $proc_cmd \n"; kill 9,$proc_cmd; wait(); print "Child exited with: ",$? >> 8,"\n"; }