Jessee Parker wrote:

> Hi all,
> 
>     I have a script that basically waits for 2 files to be delivered to
>     it,
> then it processes the 2 files, inserts them into the database and then
> starts sending information. After information is sent, it deletes the
> record from the database and increments a counter. I do a fork in the
> subroutine that does the sending / deleting portion. What I've come to
> notice is that if I do this once, it sends everything fine and the data is
> correctly erased from the database. The next time I do this, it runs,
> doesn't complain about any errors but it doesn't do the send and it
> doesn't perform the delete. Here is the sending portion of the co

Are you running this in UNIX? whar version of Perl you have?
There is a well-known bug when using fork in Perl under UNIX. check this 
out:

http://archive.develooper.com/perl5-porters@;perl.org/msg87476.html

the bug had been reported to the Perl bug list. if you know how to use truss 
in UNIX, run your script through truss but don't trace fork and child 
execution, you will see a bunch of setContext() calls that Perl calls when 
you fork, if you do a man setContext(), you will know why this can be a 
problem. what happen is that Perl resets all process-wide static variable
in the parent process so the behavior is very odd in the parent...

someone suggest to remove the $SIG{CHLD} hanlder (if you have one) and see 
if it solve the problem or not. i haven't try this myself.

this appears to be only affect UNIX machine(ie, BSD or Linux seems to be 
ok.) But i have seen very similar situation in RH8 as well...

since i didn't read through your whole script, your problem might be totally 
different but it's something you should keep an open eye on...

david

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to