in reply to Re: How to get the CLSID with OLE::Storage?
in thread How to get the CLSID with OLE::Storage?

> Is that what you're looking for?

Not quite but your message suggested to me what the proper solution is, thanks. The solution is to apply the string() method to the CLSID returned by the package:

print $Doc->clsid($pps)->string()

works perfectly.

Regards, Vesselin

Replies are listed 'Best First'.
Re^3: How to get the CLSID with OLE::Storage?
by bontchev (Sexton) on Nov 10, 2007 at 15:29 UTC
    Interestingly, OLE::Storage does something bizarre with the byte endianness of the CLSID... For instance, in one document the CLSID of the root storage consists of the following byte sequence:

    D8 F4 50 30 B5 98 CF 11 BB 82 00 AA 00 BD CE 0B

    (I can see it with a hex editor.) For this, $Doc->clsid($pps)->string() returns

    3050F4D8-98B5-11CF-BB82-00AA00BDCE0B

    In other words, it has assumed that the CLSID consists of a little-endinan DWORD, little-endian WORD, little-endian WORD, big-endian WORD, and 6 bytes (or is it 3 big-endian WORDs?). This is a bug, IMHO. The CLSID is just a sequence of 16 bytes (no endinanness) and should be returned as such.

    Regards,
    Vesselin

Re^3: How to get the CLSID with OLE::Storage?
by erroneousBollock (Curate) on Nov 11, 2007 at 13:24 UTC
    print $Doc->clsid($pps)->string()
    Err, that's exactly the same as what I wrote. :-)

    -David