use Fcntl qw(:flock);
+my $DBI_CACHE=0; # Cache DBI requests - may cause: MySQL server has gone away
+
+
open DBI_PWD,$DBI_pwd or die "open \"$DBI_pwd\": $!";
$DBI_pwd=<DBI_PWD>;
close DBI_PWD or warn "close DBI_pwd: $!";
my $DBI;
sub DBI
{
- return $DBI if $DBI;
+ return $DBI if $DBI_CACHE && $DBI;
$DBI=DBI->connect("DBI:mysql:database=$DBI_database;host=","$DBI_user",$DBI_pwd,{
"PrintError"=>0, # handled by "RaiseError" below
"RaiseError"=>1,