2013年(3)
分类: PERL
2013-01-23 16:48:01
#!/ms/dist/perl5/PROJ/core/5.8/bin/perl -w use strict; use diagnostics; $SIG{CHLD} = 'IGNORE'; #this is only to see what's in this hash while (my ($key, $value) = each %SIG) { print $key." --> ".$value."\\n"; } my $rret=fork; if($rret) { print "this is parent process and id is ".$$."\\n"; sleep 10; } elsif ($rret == 0) { print "this is child process and id is ".$$." and it's parent process id is ".getppid."\\n"; } else { die($!); }