#!/usr/bin/perl use strict; use warnings; print "I'm parent ($0): $$\n"; my $child = fork; defined $child or die "Can't fork: $!\n"; unless ($child) { print "I'm child ($0): $$\n"; exec $^X, '/tmp/child-child.pl'; }