On 29/12/03 7:51 pm, Kevin Skelton <[EMAIL PROTECTED]> wrote:

> 
> 
> 
> 
> I am having trouble adding multiple values to an attribute on the add.  All
> else is working fine.
> 
> I use the basic add method like the following example:
> 
> my $CreateArray = [
>  objectClass => [ "top", "person", "organizationalPerson",
> "inetOrgPerson" ],
>  cn => "Jane User",
>  uid => "0000001",
>  sn => "User",
>  mail => "[EMAIL PROTECTED]"
> ];
> 
> 
> my $result = $ldap->add ( $dn, attrs => [ @$whatToCreate ] );

Since I think you've defined $CreateArray as a reference to an array, you
should be able to say:

    my $result = $ldap->add ( $dn, attrs => $CreateArray );

> However, how do I dynamically add multiple values to mail?
> I have one to many mail addresses stored in an array:  @mail.
> Can anyone point me in the right direction?

The objectClass attribute is multi-valued, so you can use the same technique
for any multi-valued attribute:

    mail => [ '[EMAIL PROTECTED]', '[EMAIL PROTECTED]' ]

Cheers,

Chris

Reply via email to