--On Tuesday, August 23, 2005 12:46 PM -0400 Rick Greene <[EMAIL PROTECTED]> wrote:

Ok, I found the problem.  Somehow (probably a default action that I
didn't know about), when taking in the LDIF formatted text from the
textarea field of the web form, dumping to a local temporary text file,
and then using Net::LDAP::LDIF's $ldif->read_entry(), ALL the attributes
were ending up with a CR (ascii 13) character at the end, and the PERL
chomp function wasn't removing it.  I got more brute-force-ish about it
and it all works now.

I did two things...after writing the $w->param('ldif') out to a file, I
then did:

system ("/usr/bin/dos2unix $tmp")

Which probably took care of everything, but I also put in the following
line in a couple of key places to be sure:

if ( ord(substr($line,-1)) <= 32 ) { chop($line) ; }

Sorry to have taken up everyone's time with this, thanks to Graham for
the one hint, hopefully this thread will help someone else along the line.

This was actually just recently discussed.

You could, I would think, use perl itself to clean up the \r\n fairly easily. ;)

$line =~ s/\r\n//;

for example, rather than chomp.

--Quanah

--
Quanah Gibson-Mount
Principal Software Developer
ITSS/Shared Services
Stanford University
GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html

"These censorship operations against schools and libraries are stronger
than ever in the present religio-political climate. They often focus on
fantasy and sf books, which foster that deadly enemy to bigotry and blind
faith, the imagination." -- Ursula K. Le Guin

Reply via email to