ennuikiller has asked for the wisdom of the Perl Monks concerning the following question:

Can someone explain the following lines of the IPC::Open3 synopsis:
$pid = open3(\*CHLD_IN, \*CHLD_OUT, \*CHLD_ERR, 'some cmd a +nd args', 'optarg', ...); use Symbol 'gensym'; $err = gensym;
I am using open3 to execute a shell command but I am getting a "fork: resource temporarily unavailable error" and I believe it may be due to not using these lines in my open3 routine. Any insight would be very much appreciated!

Replies are listed 'Best First'.
Re: synopsis of IPC::Open3
by salva (Canon) on Feb 28, 2011 at 15:23 UTC
    Let us really help you posting your program code!

    Anyway, try using strace to discover what is going wrong at the OS level.

Re: synopsis of IPC::Open3
by ikegami (Patriarch) on Feb 28, 2011 at 16:57 UTC
    \*CHLD_ERR and $err = gensym are two ways of creating a file handle to pass to open3. It makes no sense to use both. And it's not the cause of your problem.
      My educated guess is that the OP has accidentally written a fork bomb, and is noticing the error message from running out of processes.