in reply to Passing a DBI handler the proper way
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.
|
|---|