I second holli suggestion. I have used the Windows Script Component-WSC for lots of stuff and it works GREAT and you can even make it a Distributed COM object ( info in MicroSofts WSC docs ). Here is one serious pitfall that will save you some head scratching. The WSC file you create is installed most easily by right clicking the file and then selecting Register. You will also see an option "Generate Type Library". Don't waste your time. The Type Library it creates will throw a exception at runtime if you add it as a reference (in Excel or Word) because the object type defined in the Type Library does not and never could match the object you define in your WSC. MicroSoft acknowledges the problem, but doesn't change the docs or fix the problem...<sigh>. ActiveState's PerlCtrl DOES correctly generate the typelib, so if you need the typelib then purchase the PerlDevKit ( it is a great deal IMO and has lots of great stuff like perlapp and perltray and PerlNET ).

After you read the docs and try the examples, you may wonder how to share a perl hash or array with the MicroSoft world. The key is to use Win32::OLE::Variant and Win32::OLE to create either a VT_ARRAY|VT_VARIANT (use the Put method to store ) or use OLE and CreateObject("Scripting.Dictionary") if you want to use a hash-like object ( and yes, you can save other objects as keys or values) "Scripting.Dictionary" was modeled after Perl hashes I believe.:-)
I have some examples if you need more help. I am too busy right now to post them right now.
Cheers,
JamesNC

In reply to Re: Exposing perl code as a COM object by JamesNC
in thread Exposing perl code as a COM object by slloyd

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.