Created
April 1, 2012 08:26
-
-
Save shibayu36/2273379 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!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