Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: DBI: $dbh-disconnect; yes, now, now, but not now!

by turnstep (Parson)
on Mar 15, 2001 at 02:42 UTC ( [id://64530]=note: print w/replies, xml ) Need Help??


in reply to DBI: $dbh-disconnect; yes, now, now, but not now!

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; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://64530]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-25 19:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found