Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Pass signals and argv from C to embedded Perlby kschwab (Vicar) |
on Jan 31, 2019 at 13:45 UTC ( [id://1229199]=note: print w/replies, xml ) | Need Help?? |
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.
In Section
Seekers of Perl Wisdom
|
|