inline or another sub is a matter of preference. My code example was how easy it would be to do what you're trying to do if you were using
Class::DBI instead of directly using
DBI.
My criteria for good software:
- Does it work?
- Can someone else come in, make a change, and be reasonably certain no bugs were introduced?