Net::LDAP::LDIF->current_lines() seems unworkable in the new version.

W

Wang Penghui

#!/usr/bin/perl -w

use Net::LDAP::LDIF;
Hi,

I have a perl script to convert ldif file, put the base64 encoded text
to one line.

Recently it seems unworkable with the follow error:

Use of uninitialized value in print at ./readldif.pl line 14, <GEN0>
line 46735.
Use of uninitialized value in print at ./readldif.pl line 14, <GEN0>
line 46804.
Use of uninitialized value in print at ./readldif.pl line 14, <GEN0>
line 46893.

The OS is debian 5.0.4. And the libnet-ldap-perl is 0.36-1.

I have searched the web for a while but no result, could someone pick
me up?

Here are the script:

$ldif = Net::LDAP::LDIF->new( "source.ldif", "r", 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 {
if ($entry->dn =~ m/contact/) {
print $ldif->current_lines();
}
print "\n\n";
}
}

$ldif->done ( );

Thanks very much.

Penghui Wang.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,147
Latest member
CarenSchni
Top