use warnings; use strict; print "PID=$$\n"; my $child = fork(); die "Can't fork: $!" unless defined $child; sub si { my $ar = shift; print "ar is $ar\n"; } if ( $child > '0' ) { #parent process print "Parent process: PID=$$, chid=$child\n"; system("/root/program/parent_pro.pl"); } else { #child process my $ppid = getppid(); print "Child process: PID=$$, parent=$ppid\n"; #system("echo this is child"); exec("/root/program/child_pro.pl"); } print "hi how are you\n"; print "fine i am doing good\n"; si("MJ"); si("JP");