in reply to Re^4: Obtain the child process id in perl
in thread Obtain the child process id in perl

You need to avoid the intermediate shell that gets invoked because of 2>.... See exec. Replacing the redirection functionality provided by the shell involves reopening STDOUT and STDERR to the appropriate files and then executing the target program directly.