Hi,

I have a perl POP3 Server script that uses IO::Socket and IO::Select 
to handle iterative 'pseudo-non-blocking" socket io between several
clients. It uses MySQL for username/password database and NT2000 IIS'
built in SMTP for send/receive email transport. It is working well.

In view of making the script better, I tried to introduce "fork()"
to make it 'a bit' faster as well as to have better controls.

##ORIGINAL##############################
check password with MySQL
if (password is OK) {
        process it.
}
else {
        give error
}
#########################################

Some of the username/password are still within NT user-database and
havent been ported over into the mysql database. the next script
was to extract the user/pass from NT and save it into mysql.
##WITH FORK##############################
check password with MySQL
if (password is OK) {
        process it.
}
else {
        if (fork() == 0) {
                check password with NT database using win32::netadmin
                if password is ok then save this password into MySQL
                $DBH=DBI......
                $sth= $DBH->prepare(save password into mysql....
                $sth->execute;
                $DBH->disconnect;
                exit;
        }
        else {
                give error
        }
}
#######################################

I keep getting this when I tried using fork:

Attemp to free unreferenced scalar.
DBI handle cleared whilst still active.
Attempt to free non-existent shared string during global desctruction.
Attempt to free non-existent shared string during global desctruction.
Attempt to free non-existent shared string during global desctruction.
Attempt to free non-existent shared string during global desctruction.
Attempt to free non-existent shared string during global desctruction.

program terminates at this point. 

Was the program terminating because I have DBI and socket handles that 
were inherited (??) by the child process and when the child exited, it 
closed the handles and thus causing the parent to croak? 

If this *IS* the case then how do you go about using fork in such an
environment full of global handles?

I dont know what/where is wrong.
Jaime


_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to