http://qs321.pair.com?node_id=704080

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..... PerlSvc.pm lin +e 12
This is puzzling for me, because there is no PerlSvc.pm 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 PerlSvc.pm 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) Win32.pm to get some of its work done. The function it is counting on being available in Win32.pm 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.