I was using
use Win32::OLE; my $SS= new Win32::OLE:: "SourceSafe";
and after a while needed a symbolic constant, so I reached for Win32::OLE::Const. Nothing happened, and I got errors about barewords and strict. So I figured that Const doesn't get along with strict, not declaring the constants in a way that strict knows about.

So I switched to the ->Load form. Now I get an error, "no such type library".

Well, it turns out that OLE wants the ProgID, and OLE::Const wants a typelib name, which are two different names! I had to load "Microsoft SourceSafe", not "SourceSafe" (or "*SourceSafe" would have worked).

First, it's annoying that I need two different names. The automation stuff used by Win32::OLE accesses information; isn't the constant definitions in there too?

Second, why didn't I get the "not found" error with the direct use form? That's inconsistant with the Load form, and an easy way to have mistakes go unnoticed.

—John


In reply to Win32::OLE constants from typelib by John M. Dlugosz

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.