in reply to Re: Perl System('') question
in thread Perl System('') question

Hmmm... What does this do to a program that's still running when you "last" out of the loop? Like, say you're running a find, and want to kill the find as soon as it spots the thing it's looking for?
for(split(" ","tsuJ rehtonA lreP rekcaH")){print reverse . " "}print "\b.\n";

Replies are listed 'Best First'.
Re^3: Perl System('') question
by ikegami (Patriarch) on Nov 29, 2008 at 12:40 UTC
    close $eject; will wait for the child to end (after closing pipes to the child?) If you wish to save it from doing extra work, you could ask it to end by sending a TERM signal to it before calling close. The return value of open '-|' is the child's PID.

      ++ to both of you! I didn't think about that yet.


      s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
      +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e
Re^3: Perl System('') question
by ikegami (Patriarch) on Nov 29, 2008 at 12:42 UTC
    close $eject; will wait for the child to end (after closing pipes to the child?) If you wish to save it from doing extra work, you could ask it to end by sending a TERM signal to it before calling close. The return value of open '-|' is the child's PID.