steverippl has asked for the wisdom of the Perl Monks concerning the following question:
Now, warn Dumper($adsobj_child->{member}); shows me the members of the group as an array, but the foreach over either @array or directly over $adsobj_child->{member} just gives me ARRAY(0x1a94908). How do I get at that (I don't want to just assign the output of dump to a variable, I want to know what I'm not understanding!) Many thanks!use strict; use warnings; use Win32::OLE 'in'; use Data::Dumper::Simple; my $ADsPath = "LDAP://CN=users,DC=woodland,DC=wednet,DC=edu"; my $adsobj = Win32::OLE->GetObject("$ADsPath") or die "Unable to retri +eve the object for ADsPath\n"; warn Dumper($adsobj); foreach my $adsobj_child (in $adsobj) { if (($adsobj_child->{Class} eq "group") && ($adsobj_child->{samaccou +ntname} eq "Domain Admins")) { warn Dumper($adsobj_child->{member}); my @array = $adsobj_child->{member}; foreach (@array) { print "$_\n"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Extracting elements of an array reference?
by ikegami (Patriarch) on Jul 26, 2006 at 15:26 UTC | |
|
Re: Extracting elements of an array reference?
by davorg (Chancellor) on Jul 26, 2006 at 15:34 UTC | |
by steverippl (Novice) on Jul 26, 2006 at 17:01 UTC |