in reply to perl-ldap formatting question

What's happening is that even if $mesg->entries returns multiple entries, you overwrite $firstName etc. each time through the loop, so your single print is the last entry received. Instead, store the info in a handy hash and then you can print a nice sorted list (or whatever):
my ($acct,%records); foreach $entry ($mesg->entries) { $firstName = $entry->get_value("firstName"); $lastName = $entry->get_value("lastName"); $accountName = $entry->get_value("accountName"); $accountNumber = $entry->get_value("accountNumber"); $records{$accountName} = [ $firstName, $lastName, $accountNumber ]; } foreach $acct (sort keys %records) { print $acct,": ",join(' ',@{$records{$acct}}),"\n"; }

HTH, SSF