[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: problem in search result of query



  Hi kavita!

On Tue, Jun 26 2001 13:12, you wrote:

k> I'm attempting to retrive a multi-valued attribute from the LDAP database
k> using Net::LDAP. This method returns only one value, instead of returning
k> all the values. The search works ok from the command line. Does anyone
k> have any ideas about aworkaround for this?

I'm using OpenLDAP 2.0.11, perl 5.005 and Net::LDAP 0.23, also i'm using
get_value method to get attribute values and don't have such problems, all
works fine. Here is a some examples:

#get attributes as reference to array
my $d = $entry->get_value($attr, asref => 1);
print "ref_vals=",join(" ", @$d),"\n";

#get attributes as array
my @dd = $entry->get_value($attr);
print "vals=", join(" ", @dd), "\n";

They two does the same, but if you uses scalar as result, it will contain 
only first element, may be is you problem here?

#use scalar as result, it will contain only first element of the array
my $one_attr = $entry->get_value($attr);
print "one_attr=", $one_attr, "\n";


-- 
/lenz