Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4232
  • 博文数量: 3
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 40
  • 用 户 组: 普通用户
  • 注册时间: 2011-10-13 20:13
文章分类

全部博文(3)

文章存档

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($!);
}

阅读(139) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:vim tricks

给主人留下些什么吧!~~