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.
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.