tags:

views:

122

answers:

2

I a perl code have seen the REAPER has used as a signal handler for SIGCHLD signal .

$SIG{CHLD} = \&REAPER;

The function also not defined in the code . Can any one deeply explain the internal operation on the `REAPER` .

Thanks in advance.

+2  A: 
  • Read : PerlIPC-Perl interprocess communication (signals, fifos, pipes, safe subprocesses, sockets, and semaphores).

  • Read: "Reaping Zombies" from Chapter 16.01 in "Perl Programming third Edition" by Larry Wall

Nikhil Jain
That just shows how to write your own `REAPER` but the OP complains it isn't written in his code.
Philip Potter
@Karthi: Both links will help you to understand how it is working. It might be possible it is used for Zombies but for that case also REAPER function should be there.
Nikhil Jain
@Philip Potter: if it is not written, the code won't work.
Grrrr
That's true. Thanks:)
Nikhil Jain
@Nikhil - please do not link to pirated copies of books (your second link)
DVK
@DVK: ok, will not do next time, thanks for telling me.
Nikhil Jain
I never realised that was a pirate site. naively I'd just assumed it was something to do with O'Reilly!
Martin Smith
@Martin - `.ua` = O'Ukraine.
DVK
@Martin Smith: Exactly, I also never realised it.
Nikhil Jain
+2  A: 
    All Our perls have run
    Here but now they're hung
    Children don't fear the reaper
    Nor Do the wind, the sun or the rain
    We can be like they are

    Come on process, Don't fear the Reaper
    Baby take My file, Don't fear the Reaper
    We'll be able to crash, Don't fear the Reaper
    Baby it's your code

REAPER is just a placeholder name for code you have to write yourself. See perlipc for more details.

Eric Strom
Your poem doesn't compile. :-(
mobrule
add `sub UNIVERSAL::AUTOLOAD {}` before it :-)
Eric Strom
Needs more cowbell.
Jon B