| Previous | Next
Win32::OLE::EnumThe Win32::OLE::Enum module provides special support for collections. Collections are special automation data types that contain an array of objects or data. A collection supports enumeration; you can iterate through each item through a standard interface. Collection objects should always provide a Collection objects also support a standard COM interface (IEnumVARIANT) that allows you to enumerate each item in a collection. It defines methods that let you advance the iteration to the next item, skip a given item, restart the enumeration, and create a new copy of the iterator. While all servers are supposed to provide this interface, some servers don't implement all of the methods (often Win32::OLE::Enum defines these methods for enumerating collections. The collection object should provide the
For the enumeration methods, you need to create an enumeration object for the collection object: $coll = $obj->some_coll( ); $enum = Win32::OLE::Enum->new($coll); Now you can use the enumeration methods on the object. Win32::OLE::Enum MethodsThe following methods are defined in Win32::OLE::Enum.
Win32::OLE::Enum->new($obj) Creates a new Win32::OLE::Enum object. Provides it with a collection object or an existing Enum object, in which case it calls
$Enum->All( ) Returns a list of all objects in the collection. Note that to use
$Enum->Clone( ) Returns a copy of the current iterator. This method is supposed to maintain the same iteration position, if possible, but may be unimplemented.
$Enum->Next([count]) Returns the next item in the collection. You can optionally provide
$Enum->Reset( ) Restarts the enumeration with the first item in the collection.
$Enum->Skip([count]) Skips the next |