Custom Function Problem/Work Around

Kyle Harris lists at TRCINTL.COM
Fri Oct 17 15:31:06 IST 2003


I have a custom function created in the CustomConfig.pm that connects to a
MySql database.  As per the docs, my custom function has three parts
(InitMyFunction, EndMyFunction, and MyFunction).  Per the docs in the
CustomConfig.pm, I have my database connection in the InitMyFunction
section.  I was continuously having problems with queries sometimes
returning the correct answer and sometimes returnning now answer at all.  A
separate Perl script I created for test purposes with the exact same SQL
statement would always return the correct result.

After fighting with it for a while, it occured to me to move the database
connection from the InitMyFunction to the actual function, in this case
MyFunction.  It has not failed since.  The connect statement is exactly the
same as I copied and pasted it.  If I move it back making no other changes,
I get the same sporadic results.

I'm curious if this is a bug and if anyone else has expierenced it?



More information about the MailScanner mailing list