http://www.perlmonks.org?node_id=1013873


in reply to close_on_exec in Perl : close socket opened in parent process when fork child , is not working

I'm not sure exactly what you are expecting and how it is not working to your satisfaction. I suspect it is possible to figure that out from what you've provided, but I am finding it rather difficult so I suspect that making that easier may lead to more helpful responses.

For example, what does "i saw that the port '4444' was already openning by the shell script's program" mean? Is this based on running something like "netstat"? Perhaps if you show the command you ran and the part of the output that you noticed, then it will make your problem easier to understand.

close-on-exec only closes the instance of the FD in the child. It doesn't do anything to the FD that is open in the parent process. Perhaps you want exec instead of system?

- tye