in reply to Re: Win32::Daemon Experience offered/requested
in thread Win32::Daemon Experience offered/requested

You must update $state inside your loop:
$state = Win32::Daemon::State();
Or better, just put only your job timeslice inside the $state == SERVICE_RUNNING condition as there is already a loop outside.

Replies are listed 'Best First'.
Re^3: Win32::Daemon Experience offered/requested
by zoom (Initiate) on Oct 08, 2009 at 22:36 UTC
    Neither of those solutions work because it is still waiting for the sleep() to finish. This is apparent when I increase the sleep from 2 seconds to 500 seconds, which better emulates the time-intensive function that my program is doing (enumerating all files on the hard drive and adding their sizes). Any other ideas on how to handle this?