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
you can do:sub george_connect { return DBI->connect('yada yada'); }
which maintains a handle one created, but never tried to reconnect it again.my $dbh; sub george_connect { if ( !$dbh ) { $dbh = DBI->connect('yada yada'); } return $dbh; }
-----------------------------------------------------
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
|
|---|