[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-ldap-dev
Subject:    Re: Adding an attribute with multiple values.
From:       Chris Ridd <chrisridd () mac ! com>
Date:       2004-11-11 21:04:47
Message-ID: BDB9846F.673BF%chrisridd () mac ! com
[Download RAW message or body]

On 11/11/04 8:15 pm, Relho de Couro <relho.de.couro@gmail.com> wrote:

> Hi,
> 
> It maybe a simple question. But I'm having some troubles with it.
> I'm using Net::LDAP::Entry and I'm trying to add an attribute with
> multiple values.
> Unfortunately, until now it didn't work out.
> 
> A simple example:
> 
> attr: value1
> attr: value2
> 
> Just calling entry's add method multiple times does not worked out.
> Replace method didn't work out ether.
> 
> Maybe I'm doing something wrong.
> 
> Could someone give me an better idea or exemple on how to solve this problem?

It works for me:

$e = Net::LDAP::Entry->new;
$e->dn("cn=Test User,c=RU");
$e->add("objectclass" => [qw(top person)]);
$e->add("sn" => "User");
$e->add("cn" => "Test User");
$e->add("sn" => "Frob");
$res = $e->update($ldap);

The resulting entry has two values for sn.

Cheers,

Chris


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic