in reply to syntax for while substr

i think you want
while ((substr$_,0,19) !~ /objectclass: person/) { ... }

the "does not match" operator is !~, and not <>~

hope this helps,