Perl wait Function

Advertisements


Description

This function Waits for a child process to terminate, returning the process ID of the deceased process. The exit status of the process is contained in $?.

Syntax

Following is the simple syntax for this function:

wait

Return Value

This function returns -1 if there are no child processes else the Process ID of deceased process

Example

Following is the example code showing its basic usage:


When above code is executed, it produced following result




Advertisements
Advertisements