I would do it. The only real problems you might get with this approach is if you need multiple handles or switch schemas.
The singleton approach won't deal with stale handles. Once your $dbh has lost its connection, you'll have to live with that bad value for the lifetime of your script. connect_cached solves the issues you describe, _and_ will handle reconnecting for you. IMHO, it makes Apache::DBI redundant (although it doesn't hurt).
In reply to Re^2: OO question
by rhesa
in thread OO question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |