http://www.perlmonks.org?node_id=1150989


in reply to win32::daemon memory leak

Hello tbsky,

Can you give example code for a service you run, together with the command sequence you issue to control service installation, etc.? So far, I’ve not been able to get your code to work — but that’s likely because I don’t know enough about the Win32::Daemon module. :-(

In the meantime, perhaps you could try a module such as Test::LeakTrace. Here’s how I would proceed:

BTW, the following isn’t very informative:

print "Failed to install service: $!\n";

From the documentation, the correct way to report failure is like this:

print 'Failed to install service: ', Win32::FormatMessage(Win32::Daemon::GetLastError()), "\n";

Also, you have use Fcntl;, but I don’t think it’s actually used anywhere, is it?

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,