programming-examples/perl/SystemFunction/Using waitpid.pl
2019-11-15 12:59:38 +01:00

12 lines
284 B
Perl

#!/usr/local/bin/perl
$procid = fork();
if ($procid == 0) {
# this is the child process
print ("this line is printed first\n");
exit(0);
} else {
# this is the parent process
waitpid ($procid, 0);
print ("this line is printed last\n");
}