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

Discussion in 'Perl Misc' started by Wang Penghui, Nov 1, 2009.

  1. Wang Penghui

    Wang Penghui Guest

    #!/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.
     
    Wang Penghui, Nov 1, 2009
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    538
  2. Replies:
    2
    Views:
    175
  3. Replies:
    2
    Views:
    199
  4. Replies:
    2
    Views:
    841
  5. Replies:
    0
    Views:
    166
Loading...

Share This Page