Hi, there
I'm doing currently some work with Net::LDAP and have encountered a very
wierd problem, but perhaps I'm just crosseyed. Here is a minimal-example
of code, that doesn't work properly:
-->Cut
#!/usr/bin/perl -w
use strict;
use Net::LDAP;
use Net::LDAP::LDIF;
use IO::File;
use utf8;
use Authen::SASL;
use Carp;
my $sasl = Authen::SASL->new ( 'GSSAPI',
user => 'u:kgorling',
);
my $ldap = Net::LDAP->new ( 'emmi' ) or croak "Fehler: [EMAIL PROTECTED]";
#$ldap->debug(15);
my $bind = $ldap->bind ( "",
sasl => $sasl,
version => 3,
onerror => 'warn',
async => 1,
);
print "Meldung von ldap-Bindung: ", $bind->error,"\n";
croak if $bind->is_error;
my $search = $ldap->search (
base => 'ou=people,ou=pcpool,ou=physik,o=tu-berlin,c=de',
filter => "uid=opfer",
);
if ( $search->is_error ) {
croak $search->error,"\n";
}
my @entries = $search->entries;
while ( defined(my $entry = <@entries>) ) {
my $ldif = Net::LDAP::LDIF->new ( \*STDOUT, "w", onerror => 'warn' );
$ldif->write_entry($entry);
$ldif->done;
}
$ldap->unbind;
<--Cut
The programm dies with a "Entry 'Net::LDAP::Entry=HASH(0x83f45e4)' is not a valid
Net::LDAP::Entry object"
If I do a ref($entry), I see, that the variable $entry is not a
reference at all, which confuses me, since Net::LDAP::Search->entries should
return an array of Net::LDAP::Entry-Objects.
What am I doing wrong?
--
Wurstsonderpostenladen
-----------------> JabberID [EMAIL PROTECTED] <------------------
Schl.-Fingerabdruck = 088C B735 8FE9 CFF2 2FEA BF8C 11A2 211A 5BBE 8E05