in reply to How to share DBI connections between objects?
my @returned = withDB { # In here $_[0] is the database connection # Connection will be closed automatically when this sub exits. # Any exceptions will be caught, database handles # cleaned up, and the exception re-thrown. # Optionally pass 'handle factory' after this block. };
withDB { forSelect { # $_[0] is a hashref of current row from selection. } shift, $query, \@bindvals; };
|
|---|