Hello enlightened ones.

An OLE2 file (e.g., the documents produced by Word, Excel, etc.) is a "hierarchical file system in a file" with its own "files" (called "streams"), "directories" (called "storages"), FAT, clusters, etc. The package OLE::Storage provides a very nice interface to the internal structures of the OLE2 files. For instance, you can enumerate the streams and storages, open them, read them, etc.

Each stream or storage has various properties - like name, size, date, time and so on. In particular, it has a property called CLSID.

In practice, the CLSID is a 16-byte value associated with each stream or storage. For a project of mine, I need to obtain the CLSID of the root storage. The problem is, I can't figure out how to obtain it with OLE::Storage. :-(

According to the documentation, the package provides the method clsid() - as in $clsid == $D->clsid($pps). But I can't figure out how to use it. :-(

I tried

print $Doc->clsid($pps) if ($Doc->is_root($pps));

but something bizarre gets printed - like

OLE::Storage::Property=HASH(0x1c5a718)

Any ideas how to use this package properly to obtain the CLSID?


In reply to How to get the CLSID with OLE::Storage? by bontchev

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.