in reply to DBD::CSV Memory Leak
Update: I have the use strict and use warnings at the begining of my full script at my scratchpad. -----sub Check_For_Call { my ($dsm,$server,$agt,$inst_det) = @_; my $dbh = (); my $sth = (); my $query = (); $num = (); $dbh = DBI->connect(qq{DBI:CSV:f_dir=$xcall_path}) or die &Debug_L +og("\nDEBUG - Problems Connecting to CSV File\n"); $dbh->{'csv_tables'}->{'Exist'} = { 'file' => 'ExistCalls', 'sep_char' => ';', 'eol' => "\n"}; $query = "SELECT CallNum FROM Exist where Dsm like '$dsm' and Serv +er like '$server' and Agent like '$agt' and Instance_Detail like '$in +st_det'"; #&Debug_Log("SELECT CallNum FROM Exist where Dsm like '$dsm' and S +erver like '$server' and Agent like '$agt' and Instance_Detail like ' +$inst_det'\n"); $sth = $dbh->prepare($query) or &Debug_Log("\nDEBUG - Problems + Preparing the SQL Statement in Check_for_Call\n"); $num = $sth->execute() or &Debug_Log("\nDEBUG - Problems Execu +ting the SQL Statement in Check_for_Call\n"); if (defined $num) { chomp($num); $sth->finish(); $dbh->disconnect(); return ($num); } else { #No Call Number Defined $sth->finish(); $dbh->disconnect(); return (2); } $sth->finish(); $dbh->disconnect(); return(1); }
|
|---|