Hello Monks,

Here's something I want to throw out.I am feeling real dumb about this.I have a script that I want to run as a win32 service.After looking at a lot of ption (srvany.exe, win32::deamonize etc) I decided that it would probably be a lot easier to just buy PDK 7.5 and use the perlsvc utility to create the service.

i found a tutorial @ http://ivoronline.com/Programming/PERL/Tutorials/PERL%20-%20Support%20-%20PerlSvc.php

so if my code is
#!usr/bin/perl use modules XYZ while(1){ DO ABC }
Where would i place my code in the code that they have provided if i need to get it to run as a service? Their code is
MyService.pl package PerlSvc; $PerlSvc::Name = "MyService"; #Short name by which your service is known. $PerlSvc::DisplayName = "MyService Display"; #Display name in W +indows Control Panel. sub PerlSvc::Startup(){ #Function called when the service is started. my $exitloop = 1; my $sleep = 1; while ($exitloop) { $outputFile = "C:/TEMP/Perl/myservice.log"; if(!open(myOutput, ">>$outputFile ")) { print("Could not open" +.$outputFile); } print(myOutput localtime(time)."\n"); print localtime(time)."\n"; close(myOutput ); sleep $sleep; } }
Thanks -Sandhya

In reply to perlscv help required. by smanicka

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.