in reply to RE: OLE VB to Perl
in thread OLE VB to Perl

Thank that was just what I was lookin' for.
foreach $child(Win32::OLE::Enum->All($ADS)){ print $child->Name . "\n"; }
I shall own the Win2k Active Directory!!!!

Replies are listed 'Best First'.
RE: OLE VB to Perl
by jehuni (Pilgrim) on Jul 23, 2001 at 19:37 UTC

    I know that this is amazingly belated, but I've been wrestling with the same issue myself and came across this thread. There's actually an easier solution to iterating over OLE collections, and it goes a little something like this:

    use Win32::OLE 'in'; foreach $member (in $collection) { #do some stuff }

    Oddly enough, I gleaned this from the Win32::OLE docs :-). The 'in' function is not exported by default, so you need to specify it in the import list, as above.

    Again, sorry for the late reply, but hopefully this will help latecomers like myself who may stumble across this thread.

    -jehuni