in reply to Function for Timing out shell commands without getting Zombie Prozesses

See in timedCommand() in Re^3: Backticks and SIGALRM.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re: Function for Timing out shell commands without getting Zombie Prozesses
  • Download Code

Replies are listed 'Best First'.
Re^2: Function for Timing out shell commands without getting Zombie Prozesses
by Anonymous Monk on Sep 15, 2011 at 18:53 UTC

    don't work, getting Can't kill a non-numeric process ID at ./t.pl line 36.

Re^2: Function for Timing out shell commands without getting Zombie Prozesses
by bae11208 (Initiate) on Sep 15, 2011 at 18:54 UTC

    don't work, getting Can't kill a non-numeric process ID at ./t.pl line 36.

      Can't kill a non-numeric process ID at ./t.pl line 36.

      Being as the script I linked to only has 35 lines, you must have changed something.

      Given the reference to "kill", it would have to be one of these two lines producing the error:

      kill 0, $pid while sleep 1 and $timeout--; kill 3, $pid and return if $timeout;

      And given that $pid is set by this line:

      $pid = open my $fh, "$cmd |" or die "$!, $^E";

      it can only take a numeric value or undef. If it was undef, due to the command failing to run, then the die would have prevented the code reaching the kill lines.

      So, what did you change and why?


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.