in reply to Re: Using a single DBI handle in a script and a module
in thread Using a single DBI handle in a script and a module

Actually, going further with this, if you grab your dbh handle from a function in the 'main' part of the module, you can create a so-called singleton-like system, thus instead of:
sub george_connect { return DBI->connect('yada yada'); }
you can do:
my $dbh; sub george_connect { if ( !$dbh ) { $dbh = DBI->connect('yada yada'); } return $dbh; }
which maintains a handle one created, but never tried to reconnect it again.

-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important