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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.