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

I need to build a COM component for a Windows system that can be called from the web. I have searched the site and cannot find a reference to this.

Does anyone know how I would go about doing this in Perl rather than having to sit down and learn C# or VB?

Ed

Replies are listed 'Best First'.
Re: Windows COM Component?
by jand (Friar) on Aug 16, 2003 at 00:33 UTC
    Did you look at PerlCtrl, part of the ActiveState Perl Dev Kit? You can download a free trial and try it out for 21 days. A simple sample is explained in A Walk Through the Code.

    Another (but free) alternative would be Windows Script Components, which are a little harder to deploy.

    Disclaimer: I'm the ActiveState tech lead for the Perl Dev Kit.

Re: Windows COM Component?
by NetWallah (Canon) on Aug 16, 2003 at 04:22 UTC
    When I think about the amount of plumbing it would take to do this right, my head hurts. It would be SO much easier to write the component in VB, and call a perl DLL when necessary.

    As an perly alternative, you may want to consider writing a web service which is currently more in fashion (although slower than COM+), but, your app may use a small number of calls to this, in which case, you get an OS-agnostic portable component.

Re: Windows COM Component?
by gellyfish (Monsignor) on Aug 16, 2003 at 08:19 UTC

    You can do this by building a windows script component. I believe the creation and use of these with Perl is documented with the Activestate Perl distribution. The microsoft documentation can be found here

    I have used components thus produced to access the functionality of Perl Modules that would otherwise be a pain to reimplement in C#

    /J\
    
      If you are interested in using Perl modules from other .NET languages you may also want to take a look at PerlNET (part of the Perl Dev Kit) which lets you create strongly typed .NET interfaces for your Perl code. It provides tighter integration with the .NET Framework than just COM interop.

      Disclaimer: I'm the tech lead of the Perl Dev Kit, the PDK is a commercial product, yada, yada.