in reply to Passing a DBI handler the proper way

Can you post more code, ideally a minimal program that runs, but experiences the problem you're asking about? (There's also a good chance that you'll find the answer yourself in the course of creating such a minimal example.)

The little bit that you've already posted looks correct, so I'm fairly sure your problem is in the code you haven't posted.

The only other thing I can see is that, whenever DBI complains about the absence of an explicit disconnect, it means your handle is going out of scope and being destroyed before you call $conn->disconnect, which is somewhat unsafe. You should always call disconnect when you're done with the database handle. This warning is likely coming when the main program exits (since that's where you're originally setting up $conn) and has nothing to do with the sub, though.

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