Skip to content

Instantly share code, notes, and snippets.

@shibayu36
Created April 1, 2012 08:26
Show Gist options
  • Save shibayu36/2273379 to your computer and use it in GitHub Desktop.
Save shibayu36/2273379 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)";
die;
}
else {
for (1..5) {
sleep 1;
warn "I'm an orphan!"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment