in reply to ldap search question

The LDAP protocol allows to specify a subset of attributes to retrieve in the search method.

Net::LDAP supports that feature via the attrs parameter. For instance:

$mesg = $ldap->search( base => "o=acme.com", scope => 'sub', filter => "sn=smith", attrs => [qw(sn givenName department)] );