I poked around the archives looking for any reference to changes in the
as_struct method in ::Search, but found none -- so I come a-beggin' :-(
Here's the central part of the code in question:
#
# start perl
#
my $l = Net::LDAP->new( 'directory.ogi.edu' ) or die "$@";
$l->bind();
my $mesg = $l->search(
base => $base,
filter => $filter,
attrs => \@fields,
);
$mesg->code && die $mesg->error;
my $href = $mesg->as_struct();
print map { "$_ : $href->{$_}\n" } keys %$href;
#
# end perl
#
I've run the code on two fairly identical Linux boxes, the first equipped
with perl-ldap 0.13, the second 0.17.
On the box with 0.13, I get what I'd come to expect:
[heinlein@redbone heinlein]$ perl ~/ldap/z.pl
employeeNumber=0001058, dc=ogi, dc=edu : HASH(0x81a75b4)
employeeNumber=0001383, dc=ogi, dc=edu : HASH(0x82c8668)
employeeNumber=0001025, dc=ogi, dc=edu : HASH(0x82c8770)
employeeNumber=0001384, dc=ogi, dc=edu : HASH(0x82c86bc)
employeeNumber=0001745, dc=ogi, dc=edu : HASH(0x82c871c)
employeeNumber=0001152, dc=ogi, dc=edu : HASH(0x82c86a4)
employeeNumber=0001810, dc=ogi, dc=edu : HASH(0x82c86e0)
On the box with 0.17, however, I get the DNs just fine, but it looks for
all the world that the as_struct() hash has only keys, no values:
[heinlein@roadkill heinlein]$ perl ~/ldap/z.pl
Use of uninitialized value at /home/users/heinlein/ldap/z.pl line 28.
Use of uninitialized value at /home/users/heinlein/ldap/z.pl line 28.
Use of uninitialized value at /home/users/heinlein/ldap/z.pl line 28.
Use of uninitialized value at /home/users/heinlein/ldap/z.pl line 28.
Use of uninitialized value at /home/users/heinlein/ldap/z.pl line 28.
Use of uninitialized value at /home/users/heinlein/ldap/z.pl line 28.
Use of uninitialized value at /home/users/heinlein/ldap/z.pl line 28.
employeeNumber=0001058, dc=ogi, dc=edu :
employeeNumber=0001383, dc=ogi, dc=edu :
employeeNumber=0001025, dc=ogi, dc=edu :
employeeNumber=0001384, dc=ogi, dc=edu :
employeeNumber=0001745, dc=ogi, dc=edu :
employeeNumber=0001152, dc=ogi, dc=edu :
employeeNumber=0001810, dc=ogi, dc=edu :
Interestingly, the same search() works well on both machines if I unravel
the results using all_entries():
foreach my $e ( $mesg->all_entries ) { $e->dump; };
Clues welcome.
Paul Heinlein
hei...@cs...
|