in reply to Passing a DBI handler the proper way

That happens when the last reference to the handle goes out of scope.

If you don't keep a reference to the handle after calling the sub, then when the sub returns the last handle will go out of scope, causing the error you describe.

There's lots of other possibilities, too; you'll need look through your code with this possibility in mind. If you can't find it, reduce it to a very small example and post that.

  • Comment on Re: Passing a DBI handler the proper way