Skip to content

Instantly share code, notes, and snippets.

@shibayu36
Created April 1, 2012 08:05
Show Gist options
  • Save shibayu36/2273122 to your computer and use it in GitHub Desktop.
Save shibayu36/2273122 to your computer and use it in GitHub Desktop.
#!perl
use strict;
use warnings;
my $pid = fork;
die "Cannot fork: $!" unless defined $pid;
if ($pid) {
warn "pid:$$ is a parent process(child pid is $pid)";
wait;
}
else {
warn "pid:$$ is a child process(parent pid is $0)";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment