You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
353 B
Perl

#!/usr/bin/perl
use warnings;
use strict;
$| = 1;
my $pid = 0;
if ( $pid = fork() ) {
print( "Parent executing.\n" );
sleep( 2 );
print( "Parent finished.\n" );
}
elsif ( defined( $pid ) ) {
print( "Child executing.\n" );
sleep( 2 );
print( "Child finished.\n" );
exit();
}
else {
die( "Could not fork" );
}