Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Pass signals and argv from C to embedded Perl

by kschwab (Vicar)
on Jan 31, 2019 at 13:45 UTC ( [id://1229199]=note: print w/replies, xml ) Need Help??


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.
  • Comment on Re: Pass signals and argv from C to embedded Perl

Replies are listed 'Best First'.
Re^2: Pass signals and argv from C to embedded Perl
by bliako (Monsignor) on Jan 31, 2019 at 16:15 UTC

    That works thank you

      Can you post the version that incorporates ikegami's source?

        I have updated a post further up with the working code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1229199]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2024-04-16 09:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found