# $adsPath is a path to a single userobject returned by a # previous search by the global catalog, just GC:// replaced # with LDAP://, e.g. # LDAP://ADS_Server/CN=Panther\, Paul,OU=test,DC=xyz,DC=de my $object = Win32::OLE->GetObject($adsPath); unless ($object) { # ... } foreach my $attr (@$attributeList) { if (ref($object->{$attr}) eq 'ARRAY') { # ... } # if elsif (ref($object->{$attr})) { # ... } # elsif elsif (defined $object->{$attr}) { if ( ???????? ) { # binary -> print as hex-string print "$attr: ", unpack("H*", $value), "\n"; } # if else { # text -> print as text print "$attr: $value\n"; } # else } # elsif } # foreach # .....