O Perl-on-Windows-mavens,

In my continuing quest for implementing a perl program on a windows box, I did the following --

wrote a perl script that works correctly. Let's call it foo.pl

converted foo.pl into a executable, foo.exe using pp. foo.exe also works correctly. It is actually magical to take foo.exe, stick it on a computer without perl on it, and see it work just fine.

wrote a variation of foo.pl using Win32::Daemon (lets call this bar.pl), and used sc to install it as a service, start, and stop it. Works correctly.

Now, I would like to convert bar.pl into bar.exe using pp and then install bar.exe as a service. Uh oh. Doesn't work. Here is the error (everything else being the same) --

Can't locate loadable object for module Win32::Daemon in @INC (@INC co +ntains: CO DE(0xcba6f8) CODE(0xdaa078) .) at ../blib/lib/PAR/Heavy.pm line 101 Compilation failed in require at script/bar.pl line 11. BEGIN failed--compilation aborted at script/bar.pl line 11.

Making an exe is really cool because then I don't need to install Perl on the target computer. However, I still need to open up a cmd window and run the darn thing.

Making a service is really cooly because then I don't have to worry about opening a cmd window to run it, however, if I can't make a service out of the exe then I will have to install Perl on the target computer.

Guidance will be much appreciated on this penultimate day of the year.


In reply to Perl script to EXE to Windows Service by punkish

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.