perl的”定义或“例子

    xiaoxiao2022-07-14  165

    [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; };
    最新回复(0)