M
Mike Solomon
Using the following code I get a memory leak
I am using ActiveState Perl 5.8.0 on Windows
I suspect it is caused by Xbase
Any ideas to fix it would be much appreciated
use strict;
use XBase;
for (0 .. 100000000) { Process($_); sleep 3;}
exit;
sub Process {
my ($counter) = @_;
my $error;
my $dbf;
unless ($dbf = new XBase "survey.dbf") {
$error = XBase->errstr;
print $error;
}
#get last record from audit
my $last = $dbf->last_record;
$dbf->close;
print "LAST RECORD FROM dbf $last $counter\n";
return;
}
__END__
I am using ActiveState Perl 5.8.0 on Windows
I suspect it is caused by Xbase
Any ideas to fix it would be much appreciated
use strict;
use XBase;
for (0 .. 100000000) { Process($_); sleep 3;}
exit;
sub Process {
my ($counter) = @_;
my $error;
my $dbf;
unless ($dbf = new XBase "survey.dbf") {
$error = XBase->errstr;
print $error;
}
#get last record from audit
my $last = $dbf->last_record;
$dbf->close;
print "LAST RECORD FROM dbf $last $counter\n";
return;
}
__END__