in reply to parsing ldapsearch results

First, why don't you use Net::LDAP? It will take care of parsing for you, provide a more native interface to LDAP, and is likely to be faster.

If you can't for some reason, pasting in a sample nonworking ldapsearch command and its output would let more people help you. You really just have a parsing problem, and if you give us some sample data you can get help even from people who don't know (or remember) the specifics of the ldapsearch command.

Update: I remembered ldapsearch's syntax better. The problem is that your regexp is only asking for the first match. To get them all, wrap it in a while loop and use the g modifier:

while (/^$att:\s*(.*)$/img) { my $val = $1; print "$att is '$val'\n"; }