Perl fork Function - Perl Scripting

what is Perl Fork function?

Description

This function forks a new process using the fork( ) system call. Any shared sockets or filehandles are duplicated across processes. so, you must be clear that you wait on your children to prevent "zombie" processes from forming.

Syntax

Following is the simple syntax for this function −

Return Value

This function returns undef on failure to fork and Child process ID to parent on success 0 to child on success.

Example

Following is the example code showing its basic usage −
When above code is executed, it produces the following result −

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Perl Scripting Topics