in reply to parsing ldapsearch results
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 ...
By guaranteeing freedom of expression, the First Amendment also guarntees offense.