Hi Peter, Thank you it works perfectly when i replace the CR/LF by an LF in the LDIF file. I don't have test the patch because the script will turn on UNIX so the file will be correct.
I you wan't i can test the patch, but i don't know how to pass it. Thank you Lionel Peter Marschall <[EMAIL PROTECTED]> 29/07/2005 13:25 A [email protected] cc Lionel HELOU <[EMAIL PROTECTED]> Objet Re: Script block on Linux Hi, it looks like you are reading from an LDIF file. perl-ldap currently has the issue that it can only read correctly LDIF files that have the correct line ending for the operating system the script is running on (i.e. CR+LF on Win, LF only on Unix). To check whether this is the cause of the problem, please convert your LDIF file to Unix file end convention and try to re-run your cript against this modified LDIF file. If the script works with this modified input file you may want to apply the attached patch against the LDIF.pm version 0.16 and retry the script again with the original input file. Note: this patch is not extensively tested, so you better keep a backup copy of your LDIDF.pm file ;-) Please report feedback about success / failure. Yours Peter On Friday 29 July 2005 10:49, Lionel HELOU wrote: > Hi everybody, > > I have a problem with this script, it works perfectly on windows XP but it > blocks on Linux Red Hat 7.3 (2.4.20-28.8smp). > It seems to be on the "read_entry()" function. > > Do you have an idea ? > > > #!/usr/bin/perl -w > > use Net::LDAP::LDIF; > > open(RES, "+>/home/lhelou/scripts/test.log") or die "Impossible d'ouvrir > le fichier test.log $! ..!! \n"; > > $ldif = Net::LDAP::LDIF->new( "/home/lhelou/scripts/index.ldif", "r", > encode =>"base64", onerror => 'undef' ); > > while( not $ldif->eof ( ) ) { > $entry = $ldif->read_entry ( ); > if ( $ldif->error ( ) ) { > print "Error msg: ", $ldif->error ( ), "\n"; > print "Error lines:\n", $ldif->error_lines ( ), "\n"; > } else { > print "$entry\n"; > } > } > $ldif->done ( ); > close(RES); > > > Thanks in advance. > > Lionel -- Peter Marschall eMail: [EMAIL PROTECTED] [rattachement "ldif.patch" supprimé par Lionel HELOU/Rennes/SII/FR]
