in reply to Re^2: Shared memory and asynchronous access
in thread Shared memory and asynchronous access

The SIG CHLD line is not met for the Windows platform. It was a last minute change when testing on Unix.

$SIG{CHLD} = 'IGNORE' if ( $^O ne 'MSWin32' );

Replies are listed 'Best First'.
Re^4: Shared memory and asynchronous access
by Anonymous Monk on Apr 06, 2017 at 08:05 UTC

    That didn't work. The following now works on Windows and Unix including Cygwin.

    my $pid; if ( $^O eq 'MSWin32' ) { $pid = system 1, $^X, 'mon2.pl', $port; } else { $SIG{CHLD} = 'IGNORE'; $pid = fork; die "Could not fork: $!\n" unless defined $pid; exec( $^X, 'mon2.pl', $port ) if ( $pid == 0 ); }

      The exec line is met to run monitored.pl, not mon2.pl.

      exec( $^X, 'monitored.pl', $port ) if ( $pid == 0 );

      Thank you, BrowserUk++.