I've been trying out some of the options above, but I've encountered some issues.

Win32::Daemon is working for me, but I'd like to use Win32::Daemon::Simple because otherwise there's a lot of skeleton code to write and, well, it's just simpler :-)

Unfortuantely, it's throwing up some errors as soon as I try to use it:

C:\tmp>perl use Win32::Daemon; use Win32::Daemon::Simple; Global symbol "$HKLM" requires explicit package name at C:/APPS/Perl/s +ite/lib/Win32/Daemon/Simple.pm line 66. Global symbol "$HKLM" requires explicit package name at C:/APPS/Perl/s +ite/lib/Win32/Daemon/Simple.pm line 78. Global symbol "$HKLM" requires explicit package name at C:/APPS/Perl/s +ite/lib/Win32/Daemon/Simple.pm line 276. BEGIN not safe after errors--compilation aborted at C:/APPS/Perl/site/ +lib/Win32/Daemon/Simple.pm line 494. Compilation failed in require at - line 2. BEGIN failed--compilation aborted at - line 2.
The Win32::Daemon::Simple code is using a variable $HKLM (when attempting to talk to the Windows registry) but it's not defined in Simple.pm.

Any ideas why this is fouling up? Where is this variable supposed to come from?

One obvious area for consideration is module incompatibilites, so here are the versions I'm using:

Win32::Daemon $VERSION = 20030617; Win32::Daemon::Simple $VERSION = '0.2.6'; Win32::Registry $VERSION = '0.07';
<fingers crossed...>

--
.sig : File not found.


In reply to Re: Turn a perl script into a Win32 Service by wol
in thread Turn a perl script into a Win32 Service by Limbic~Region

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.