#!/usr/bin/perl use strict; use warnings; my $pid; if( $pid = fork ){ print "In test1 the parent pid is $$; the child pid is $pid\n"; } else { die "could not fork a process: $!" unless defined $pid; exec ( "/liwidata/dev/tmp/jmg/dev/library/test2.pl" ) or print STDERR "couldn't exec test program: $!"; } print "All done!\n"; #### #!/usr/bin/perl use strict; use warnings; print "In test2.pl the pid is $$\n"; #### /liwidata/dev/tmp/jmg/dev/library> ./test1.pl In test1 the parent pid is 21348; the child pid is 21349 All done! /liwidata/dev/tmp/jmg/dev/library> In test2.pl the pid is 21349