I wasn't sure if i should also use the while (1), in my code if its going to be a service.Would the program exit after the first time it ran or keep working throughout without the need for the while (1)?I hope I am making sense
Try it and see what happens :)
You should use sub PerlSvc::Startup(){
while (ContinueRun(1)) {
print "I'm a service and I'm running\n";
# do prog ..........
print STDERR "And I also output errors\n";
}
#---------------------------------------------------------------------
+---
# clean up code for stopping service
#-----------------------------------------------------------------
+-------
print "Thank you and goodnight\n"
}
if you use while(1), it would never stop (net stop servicename).
Can't Stop my PerlSvc,
Problem Stopping Service using Active State Perlsvc,
Service monitor with Perl and PerlSvc,
PerlSvc Ends With Error 1067,
http://docs.activestate.com/pdk/7.3/Example.html,
|