This is a good article on this subject. This is the more simple solution using the
instsrv and
srvany applications to register and run a script as a named service(you can control them with the
net command). Dave Roth explains this in better detail in his excellent book:
Win32 Perl Scripting. In the same chapter (Chapter 8: Win32 Services) he dives into his module
Win32::Daemon which appears to be a more powerful and robust way to write services.