Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Exiting batch-started Perl script on WinXP shutdown

by brx (Pilgrim)
on Apr 17, 2012 at 13:03 UTC ( #965510=note: print w/ replies, xml ) Need Help??


in reply to Exiting batch-started Perl script on WinXP shutdown

Not tested:
You can try to use Win32::Daemon ( http://www.roth.net/perl/Daemon/ ).
This way, your script will be started and stoped as any services.


Comment on Re: Exiting batch-started Perl script on WinXP shutdown
Re^2: Exiting batch-started Perl script on WinXP shutdown
by Jenda (Abbot) on Apr 17, 2012 at 15:11 UTC

    You may even look at a wrapper of that module: Win32::Daemon::Simple. It'll take care of installation/deinstalation, logging, will store settings in registry for you allowing you to change them by calling the script with the right parameters, do the looping for you in such a way that the program responds to the service manager's requests in a timely matter, etc.

    The only catch is that you have to install a patch to Win32::Registry from http://jenda.krynicky.cz. (It was once supposed to replace the Win32::Registry on CPAN & within libwin32, but that somehow never happened.)

    Jenda
    Enoch was right!
    Enjoy the last years of Rome.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://965510]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2014-08-20 08:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (108 votes), past polls