- #!/usr/bin/perl -w
- # wangxiaoyu#live.com
- use strict;
- defined(my $pid=fork()) or die "Fork process failured:$!\n";
- unless($pid)
- {
- # This is the child process.
- system "date";
- sleep(3);
- print ("Exit child after 3 seconds wait!\n");
- exit();
- }
- # This is the parent process.
- waitpid($pid,0);
- system "date";
- print ("exit parent!\n");
关于理解Perl的fork函数
最新推荐文章于 2025-01-28 00:05:08 发布