Perl fork Function - Perl Scripting

what is Perl Fork function?


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.


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.


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 Protection Status

Perl Scripting Topics