Hi

I am writing a mod_perl handler that takes a HTTP POST and sends mail. What
I'd like to do is to open up a connection to the SMTP server [a Net::SMTP
object] and a log file [filehandle] that exist outside of the handler. So
that when the handler is run, it has access to these items, and can send
data to them, but that they don't get opened up and brought down each time.

Right now, I have them being set up [and torn down] in BEGIN {} and END {}
blocks. The code doesn't complain, and it sends the right thing back to the
browser, but nothing gets mailed or written to the log. I can post the code,
but I was hoping that this problem is generic enough [and my description
good enough] that someone can point me in the right direction without the
details of the code.

My question is this: how do you set up persistent connections that a handler
can use, but ones that don't get initalized each time the handler is called?

Are these just file [package] scoped globals?
Do I need subroutines to check the status of these objects/handles and
reinitialize them as needed?
Is there another way?

Any pointers, suggestions, or non-sequitors are welcome, thanks.

--
\js

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

Reply via email to