[root@rwsoda203db1 perl_tidb]# cat p.pl
#!/usr/bin/perl
use strict "subs";
use strict;
use v5.16;
#//定义或 如果$child_id已定义 则返回$child_id,如果$child_id undef,则执行die
my $child_id = fork() // die "cann't fork process. $!\n";
if($child_id) {
print "parent process id: $$,child process id: $child_id\n";
sleep 60;
#wait $child_id;
}else{
print "there is child process. the process id is $$\n";
sleep 60;
};
perl的”定义或“例子
最新推荐文章于 2020-08-08 00:02:06 发布