in reply to Memory Leak

Two possibilities:

  1. Call $sqlsrv->disconnect() method before your subroutine returns each time.

    From the docs:

    Disconnects from SQL Server and frees up any resources allocated for queries.

    Could be that the DESTROY() method is taking care of it for you, but it wouldn't hurt to try it.

  2. Instead of creating and destroying the connection for every query, create the connection outside the sub and re-use.
    my $sqlsrv=Win32::SqlServer::sql_init( '*Deleted*','*Params*','*For*','*Security*' ); sub GetData{ my $batch=<<SQLEND; SELECT firstname, lastname, status FROM *Now I'm just being paranoid* WHERE status is NOT NULL SQLEND my $result=$sqlsrv->sql($batch); return $result } ... END{ $sqlsrv->disconnect; }

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."