in reply to Re^2: Help converting to a Windows service
in thread Help converting to a Windows service

Hi,

What example are you following?

Have you seen https://metacpan.org/pod/Win32%3A%3ADaemon#Example-1:-Simple-Service?

It says

This example service will delete all .tmp files from the c:\temp directory every time it starts. It will immediately terminate.
use Win32::Daemon; # Tell the OS to start processing the service... Win32::Daemon::StartService(); # Wait until the service manager is ready for us to continue... while( SERVICE_START_PENDING != Win32::Daemon::State() ) { sleep( 1 ); } # Now let the service manager know that we are running... Win32::Daemon::State( SERVICE_RUNNING ); # Okay, go ahead and process stuff... unlink( glob( "c:\\temp\\*.tmp" ) ); # Tell the OS that the service is terminating... Win32::Daemon::StopService();

Does that make sense ?

Replies are listed 'Best First'.
Re^4: Help converting to a Windows service
by bajangerry (Sexton) on Mar 24, 2017 at 13:11 UTC

    I tried with that specific example as well and it also fails to run as a service so I am suspecting that there is something going on on my PC that may be preventing these from working so i am going to try with another one and see how it goes