#!/usr/bin/perl -w # parent.pl use strict; if (my $pid = fork) { print "parent: child pid is $pid\n"; } else { exec('./child.pl'); } #!/usr/bin/perl -w # child.pl use strict; print "Child: pid is $$\n"; #### parent: child pid is 26534 Child: pid is 26534