Hi,
On Friday 14 January 2005 16:28, Michael Johnson wrote:
I'm trying to use the add function:
$ldap->add($new_dn, attr=>['objectclass' => ['top','person', 'organizationalPerson', 'inetOrgPerson', 'telephonenumber' => "$phone", .... #OTHER ATTRIBUTES ] ); The telephoneNumber attribute fails with an invalid syntax error. All phone numbers are entered like this: (XXX)XXX-XXXX
perl-ldap does not check the syntax of thevtelephonenumber attribute. But the LDAP server you connecto to does.
Some servers are stricter in syntax checking than others. Here are some tips: - make suer that there are no leading or trailing spaces or tabs - try to replace the braces by spaces (ehm, not the opening one ;-)))
Hope it helps Peter
Thanks Peter, the problem was actually with the input file I was using. The DBA's are giving me a database dump that is delimited with a '|', and the phone number was the last entry on the line. I thought a simple chomp($phone) would do it. I was wrong. The file was created on a Windows machine, and ftp'd to my Linux machine. Obviously chomp was looking for '\n' and not the CR/LF that Windows drops on the end of the line. I simply ran dos2unix <filename> on the imput file and POOF! LDAP, Perl and I were friends again. Thanks for your help!
Michael
