The code you have posted seems to work fine to the extent I can test it. I left out the sub Startup ... and made 3 changes:

#use System::System_Constants; ... our $progname = q{Constants::APPLICATION_SERVICE_NAME_SHORT}; ... #Log("\n ProgName: $progname \n");

I simply tested with:

$ cat pm_perlsvc.pl #!/usr/bin/env perl use strict; use warnings; use PerlSvc;

which produces

$ pm_perlsvc.pl Path: /Users/ken/tmp/pm_perlsvc.pl Program Dir: /Users/ken/tmp/ Logfile: /Users/ken/tmp/SCC_Service.log

I see you've used File::Spec->splitpath() to get the path elements. For portability, I would recommend using File::Spec->catpath() rather than the concatenation operator (.) when joining path elements.

You haven't shown the code where you are attempting to call PerlSvc::Startup() which makes debugging from this end rather difficult.

I notice a lot of variables declared with our. If they need to be declared like this, check that you're not modifying $PerlSvc::path, $PerlSvc::directory, etc. outside of the PerlSvc package; if our $whatever is not a requirement, change it to my $whatever.

If none of that helps, post the code with the call to PerlSvc::Startup() for a better answer.

-- Ken


In reply to Re: PerlSVC and Cwd::abs_path by kcott
in thread PerlSVC and Cwd::abs_path by chowlb

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.