in reply to parsing ldapsearch results

Most likely, your data is being returned in a single output message separated by "\n".

This means that your while(<SEARCH>) loops only ONCE.

To fix this, you will need to split $_ into multiple lines, then scan each line for your @atts.

BTW, why didn't you use qw to declare and populate @atts ? You could easily have used join to make your command line ...

Offense, like beauty, is in the eye of the beholder, and a fantasy.
By guaranteeing freedom of expression, the First Amendment also guarntees offense.