in reply to DBD::CSV Memory Leak

I have moved the variables to the top of the sub as opposed to them being at the begining of the script. Still 4k per message leaks.. I'll keep looking. Thanks for the suggestions though.

the code now looks like the following:-

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

Update: I have the use strict and use warnings at the begining of my full script at my scratchpad.

-----
Of all the things I've lost in my life, its my mind I miss the most.