Interacting with COM Objects

After you have successfully obtained a COM object, your Perl script can begin having fun. You need to familiarize yourself with a couple concepts before all this will make sense: COM objects and COM collections.

COM Objects

When you create a Win32::COM object, you are creating a Perl object that represents a COM object. The COM object can contain properties and methods. By interacting with the properties and methods, you can change the state of the object and command the object to perform tasks.

If you have never dealt with COM objects before, think about starting MS Word. After you have Word running, you can consider the program’s main window to be a Word application object. You can interact with it by pressing ...

Get Win32 Perl Programming: The Standard Extensions, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.