in reply to syntax for while substr
while ((substr$_,0,19) !~ /objectclass: person/) { ... } [download]
the "does not match" operator is !~, and not <>~
hope this helps,