Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Parent process ID

use strict;
use warnings;

BEGIN {
    if ($^O eq "MSWin32") {
        print "Running on Windows\n";
        require Win32::Getppid;
        import Win32::Getppid qw(getppid);
    }
}

main();

sub main {
    my $parent = getppid();
    print "PID: $$ from parnet: $parent\n";
}