Win32::Daemon relies upon a dll, Daemon.dll which if the installation on your development machine is correct, you should find installed in

X:/perl/site/lib/auto/win32/daemon/

or somewhere similar. I've never used 5.005, so I am unsure whether the blib paths were different back then.

Adding the contents of Win32::Daemon.pm to the top of your script would work and be trivial, but the seems little point it adding its 20k to your script to save "polluting the install", when you would need to place a 72/76 kb binary in the appropriate place in the perl directory tree anyway. In any case, the general method of using Win32::Daemon appears to be to have two scripts: The first is the deamon itself (which used Win32::Daemon) and the second is a short script to install the first (which also needs Win32::Daemon). So, all you would be doing is wasting 20k of space. Whilst it wouldn't be too hard to combine the install and service scripts into one, the next time you want to create another service script your back to square one.

The bottom line is that you are going to have to put Deamon.dll somewhere. You might get away will placing it in on a server somewhere and loading it across the network to each machine, though your going to have to play some nasty tricks with Dynaloader.pm to make that work. You might even encode the dll using mime64 or similar and tack it onto the end of your script and reconstitute it at run-time, but the chances of making this work at all, never mind reliably are pretty darn slim.


Examine what is said, not who speaks.
1) When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
2) The only way of discovering the limits of the possible is to venture a little way past them into the impossible
3) Any sufficiently advanced technology is indistinguishable from magic.
Arthur C. Clarke.

In reply to Re: Can I include a package as part of my script? by BrowserUk
in thread Can I include a package as part of my script? by Anonymous Monk

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.