Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Creating Win32 Service

by Eyck (Priest)
on Aug 13, 2008 at 14:01 UTC ( #704080=perlquestion: print w/replies, xml ) Need Help??

Eyck has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to create Win32 Service, I found ActiveState's PerlApp toolkit, however, it's PerlSvc tool creates .exe which fails with:
Undefined subroutine &Win32::BuildNumber called at..... lin +e 12
This is puzzling for me, because there is no file anywhere on the filesystem.

(this doesn't happen with ActiveState's perl, but it's perl is defficient in SSL department, and doesn't work very well with CPAN)

I thought about providing my own implementation of &Win32::BuildNumber, but I have no idea where to plug it, tried putting it in INIT, but it doesn't seem to be working.

Replies are listed 'Best First'.
Re: Creating Win32 Service
by mr_mischief (Monsignor) on Aug 13, 2008 at 15:03 UTC
    I'm not real familiar with PerlApp, having read briefly about it and never used it. However, it seems you're using a tool called PerlSvc which bundles perl, some modules, and your original work into an executable file. The the that you can't find in the file system is probably part of the bundle written inside the executable.

    That bundle includes (probably also internally, although perhaps via the filesystem) to get some of its work done. The function it is counting on being available in is not available in the version it found to bundle into the executable. Win32 says that BuildNumber is only available in ActiveState's ActivePerl binary build. You must be using that version of the module in your bundling system in order to have that subroutine, it seems.

    Check how PerlSvc and PerlApp in general are documented to use include paths and how their @INC is set up. Make sure the versions of any libraries you need for proper function are the versions those tools find first.

Re: Creating Win32 Service
by Bloodnok (Vicar) on Aug 13, 2008 at 14:52 UTC
    This sounds like you're attempting to utilise the AS perlSVC tool against a different perl - if that's so, I wouldn't be at all surprised at the problems you're having.

    As a complete hack, (I would'nt suggest this other than for interest) you could extend the script (that you're converting into a service) to add a new sub to the Win32 namespace...

    sub Win32::BuildNumber { . . }
    I'm guessing that the sub returns the (what is laughingly called the) OS build level - a shortfall in your distribution perhaps ??

    A user level that continues to overstate my experience :-))
Re: Creating Win32 Service
by redgreen (Priest) on Aug 13, 2008 at 20:07 UTC
    ActiveState perl 5.10 has SSL support. (5.8 does not without using other ppm sites).
    Use ppm instead of CPAN with ActiveState perl.

      I've got perl 5.10 from ActiveState, and although it claims to be supporting SSL, it only provides Crypt::SSLeay, and trying to install IO::Socket::SSL, Net::SSLeay or anything usefull fails.

      Since I encountered more problems with installing modules I would prefer some more CPAN-friendly distribution.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://704080]
Approved by marto
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2023-03-21 16:58 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (60 votes). Check out past polls.