From: Chris R. <Chr...@me...> - 2000-07-24 09:24:52
|
On Mon, 24 Jul 2000 17:05:33 +0800, spencer wrote: > Hi, > I am new to perldap. Can someone show me how I can print out search results > after calling the ldap->search? > > Thanks. > > spencer > > $res = $ldap->search(....); foreach my $entry ($res->entries) { print "Entry returned with DN: ", entry->dn, "\n"; foreach my $attr ($entry->attributes) { foreach my $val ($entry->get($attr)) { print "Attribute \"$attr\" with value \"$value\"\n"; } } } This assumes that all attribute values will be printable, which is an incorrect assumption. JPEG photographs are not, X.509 certificates are not, etc, so the output will be odd if you have any of these attributes. Cheers, Chris |