in reply to Re^4: Defining global variable in a subroutine
in thread Defining global variable in a subroutine

An 'our' variable (or any normal variable for that matter) is not shared between parent and child after a fork.
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; }

Dave.