Hmmm ... what version of perl and what OS are you using?
The normal behaviour for exec is to close all file descriptors from SYSTEM_MAX_FD+1 to however many you have open. I can envision only a few ways for this error to happen.
- Your os does not support close-on-exec
- the code has gone out of it's way to clear the close-on-exec flag
- $^F was munged (SYSTEM_MAX_FD - normally set to 2 because you normally want stdin, stdout and stderr
passed across exec)
- the code is re-opening stdin, stdout, stderr without first closing them