Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
# Script## @entries = $mesg->entries; print "dn: " . $entry->dn() . "\n"; @attrs = $entry->attributes(); $entry->get_value($attr)); ##
Something with a generic explanation is also acceptable. I'm a newbie to perl, however at least i should how the data is getting manipulated, so that i can make use of it for future requirement. Thanks, Pamela#!/usr/bin/perl use Net::LDAP; $ldap = Net::LDAP->new("localhost"); $ldap->bind("cn=admin,dc=leapster,dc=org", password=>"secret"); $mesg = $ldap->search(filter=>"(objectClass=*)", base=>"dc=leapster,dc +=org"); @entries = $mesg->entries; foreach $entry (@entries) { print "dn: " . $entry->dn() . "\n"; @attrs = $entry->attributes(); foreach $attr (@attrs) { printf("\t%s: %s\n", $attr, $entry->get_value($attr)); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: What does arrow (->) refer to?
by kennethk (Abbot) on Dec 01, 2009 at 17:28 UTC | |
by Anonymous Monk on Dec 01, 2009 at 17:56 UTC | |
by kennethk (Abbot) on Dec 01, 2009 at 18:06 UTC | |
|
Re: What does arrow (->) refer to?
by biohisham (Priest) on Dec 01, 2009 at 17:59 UTC | |
|
Re: What does arrow (->) refer to?
by AnomalousMonk (Archbishop) on Dec 02, 2009 at 02:00 UTC |