in reply to qx(....) suddenly failing

When $? is -1, the child couldn't be launched. Check $! for the reason.

Replies are listed 'Best First'.
Re^2: qx(....) suddenly failing
by rovf (Priest) on Jun 30, 2010 at 08:12 UTC
    Check $! for the reason.
    Forgot to mention: $! said Bad file descriptor.

    In the meantime, we had the same effect on a different process, and we found out that the general behaviour was that the process was not able to open a pipe for reading anymore. For example, open(H,"xxx|") failed in the same way. Since the application executes the external commands with qx(...)), and this implicitly requires reading from a pipe, every execution of an external command was affected (while execution of commands using system was not affected). Hence the cause was the sudden inability of opening pipes, and the effect happened twice so far (and on different hosts) within a couple of days (while we had no such problems during the weeks before). I suspected that, for some reason, the process might have too many open handles, but comparing this process with others on the same host (using ProcessExplorer) did not show anything unusual.

    -- 
    Ronald Fischer <ynnor@mm.st>
      On linux, I'd use strace to see what's happening under the hood. I don't know if there's a similar tool for Windows.