That's a good question. My instinct is not to touch the hash tied by the parent from inside children in any way. I don't fork until the parent is done accessing %seen, which is ultimately untied from the parent as well. It seems logical to divide the labor by having the parent alone handle a very fast and reliable tied hash while forking off slower DNS queries to children who may add firewall rules based on the results.
I'd seriously reconsider the value of forking off those children.
Something like it has to be done or else a slow function in that while loop prevents Apache from serving requests. So far I'm seeing very few children in "top" on 1 second delay on a busy webserver, one or two at most, with no noticable slowdown.
In reply to Re^2: Apache log piped to Perl
by Anonymous Monk
in thread Apache log piped to Perl
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |