#!/usr/bin/perl

# Copyright 2004-2025, Paul Johnson (paul@pjcj.net)

# This software is free.  It is licensed under the same terms as Perl itself.

# The latest version of this software should be available from my homepage:
# https://pjcj.net

# __COVER__ skip_test $^O eq "MSWin32"
# __COVER__ skip_reason Fork unreliable

$x = 1;

die unless defined ($pid = fork);

if ($pid) {
    $x = 2;
    waitpid $pid, 0;
} else {
    $x = 3;
}

print "$x: $$\n";
