our $x = 1; my $f = fork; die $! unless defined $f; if ($f) { # parent sleep 1; print "parent: x=$x\n"; # prints 1 } else { $x = 2; exit; }