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.
In reply to Re^5: Obtain the child process id in perl
by Corion
in thread Obtain the child process id in perl
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |