use strict; my $pid = $$; print "My PID is $pid\n"; fork and exit; sleep 1 while -e "/proc/$pid/cwd"; print "My PPID is ", getppid, " after my parent is killed\n";