http://qs321.pair.com?node_id=324717


in reply to Why was it neccessary to pass a DBI handler by reference?

This is an off-the-wall guess. Have you, or could you, re-try the original code outside of the fast CGI environment?

Knowing nothing about fast CGI, I read CGI::Fast POD (which may or may not be related) and saw that it is a "persistant environment" that

Each time there's a new request, CGI::Fast returns a CGI object to your loop. The rest of the time your script waits in the call to new(). When the server requests that your script be terminated, new() will return undef. You can of course exit earlier if you choose. A new version of the script will be respawned to take its place...

The possibility struck me that this is involved somehow. It seems possible that the "spawning" process might be duplicating the parameters and causing the loss of magic somewhere. And that by passing a reference, it means that it is the reference that is duplicated, pointing to the existing blessed $dbh, and so the magic is retained?

Like I say, pure speculation....


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
Timing (and a little luck) are everything!