Here's one way to do it, if you just want a conditional:
sub make_report1 { my $dbh = shift; my $newdbh=0; if (!defined $dbh) { $dbh = &_get_dbh; $newdbh=1; } ... # close the database connection if opened here $dbh->disconnect() if $newdbh; }
In reply to Re: DBI: $dbh-disconnect; yes, now, now, but not now!
by turnstep
in thread DBI: $dbh-disconnect; yes, now, now, but not now!
by DeaconBlues
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |