if (!($pid = fork)) { # child process -- returns with 0 as pid exec('/root/Phase2/OperatorView4/recurse5.pl', $btnMpIp); } else { # we are in parent process; Store the process ID of the child in the hash $hash_ref->{$btnMpIp}->{processid} = $pid; } }