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

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 ); }

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

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

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

    Thank you, BrowserUk++.