So, I mentioned that I'd been having problems with translating lenzo's infobot code to use Tie::RDBM to store the factoids. What was happening was that some of the useful infobot extras ("dipsy, google for acme weasel") would fork and do the work in a child process. And, when the child process had done its stuff and exited, perl did the full on mark and sweep global destruction thing. Which screws up the database handles that were being held open. Which wouldn't be good.
One solution to this would be to untie the databases, fork and retie. This is probably the 'correct' solution, but is a pain in the bum with Tie::RDBM because database connections can be slow to make.
However, it turns out that the database I am using for dipsy, postgres, is threadsafe. (yay!). So as long as global destruction doesn't screw things up, we should be okay. And this is where I left it 'til this afternoon.
I came up with a solution that would involve Tie::RDBM detecting when it had been forked, and either retying, or setting some 'don't do global cleanup' flags on the DBI handle, and mentioned this on #perl before I set off to make the changes. sky heard this and suggested that I don't bother with all that, just replace the calls to exit with kill 9, $$. Which is somewhat extreme but which avoids global destruction. And what do you know, it works.
Actually, I've refined it slightly now, dngor pointed out that C
Yes, I know that this could be somewhat dangerous. But it solves my immediate problem, and I'm hoping that, by the time I want to change database again, there'll be a delightfully useful, completely POEized version of the infobot to work with. That's the plan anyway.