http://qs321.pair.com?node_id=1229199


in reply to Pass signals and argv from C to embedded Perl

Replace:
"sleep(10000);\n"
With:
"for(1..100){sleep(1);print\"$_\\n\";}\n"
And, make sure there's a newline in the print from the SIGINT handler. It should work now. The ctrl-c interrupts the sleep(10000), so that's why the perl exits. With the change above, you'll see the for loop resume after the ctrl-c.