Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Ingoring Child Processes And glob()

by merlyn (Sage)
on Jul 28, 2000 at 16:43 UTC ( #24838=note: print w/replies, xml ) Need Help??


in reply to Ingoring Child Processes And glob()

Instead of messing with $SIG{CHLD}, either
  • Double-fork, or
  • spend some time waiting at various points in your top-level loop
For example, the following code waits for any terminated kid:
## first, reap any zombies so child CPU is proper: { my $kid = waitpid(-1, 1); if ($kid > 0) { redo; } }
This comes from my WebTechniques column on logging to a DBI database.

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
RE: Re: Ingoring Child Processes And glob()
by barndoor (Pilgrim) on Jul 28, 2000 at 17:19 UTC
    Thanks a lot. I went for the second option and it is just what I needed.
    Also had a reread of the Cookbook and found it there. Doh!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2020-06-03 21:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (29 votes). Check out past polls.

    Notices?