Small problem with this line
print "Total element in idslist = $#idslist\n";
Your array index starts at 0 (unless you've set
$[ = 1. You haven't, have you?) and
$#idslist points to the last index of
@idslist, so you haven't counted the first element. I prefer to evaluate
@idslist in scalar context to get the total number, so I would write
print "Total element in idslist = ", scalar @idslist, "\n";
or something similar.
Sometimes I can think of 6 impossible LDAP attributes before breakfast.
http://ldapcon.org/2015 is just an excuse to enjoy November in sunny Edinburgh