defined(my $pid = fork) or die "Can't fork $!"; # we now have two scripts running in parallel print "I am the child\n" if $pid == 0; print "I am the parent\n" if $pid != 0; # this is another way to determine who we are if ($pid) { # do parent stuff print "Do as I say!\n"; } else { # do child stuff print "I am not deaf, I'm ignoring you!\n"; }