in reply to Re: How to make `system` not ignore SIG INT in Perl?
in thread How to make `system` not ignore SIG INT in Perl?

Try this,seems it's not working for complex case:

perl -we 'while(1){system("echo " . "1 "x 10000 . "|more");exit if ($? + & 127) == 2;}'

Replies are listed 'Best First'.
Re^3: How to make `system` not ignore SIG INT in Perl?
by Corion (Patriarch) on Sep 13, 2011 at 07:08 UTC

    The added pipe means that there now sits a shell between your program and the child processes. I would assume that the shell does not pass on the exit status of its children.

      It does!:
      $ perl -E 'system "sleep 3 | tail "; say $?' ^C2