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

> 
> 
> 
> 
>> 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
> 
> -------------------------------------------
> 
> Chris,
> 
> Thanks for your reply.
> What I mean is How do I set an array full of values into the multi-valued
> attribute?  I have an array "@mail"  which contains the values.
> How do I assign them to "mail =>"?
> I tried   "mail => @mail" but that does not seem to work.

Oh, right. You need to pass a reference to an array as the "value" for mail.
If you've got an array variable, putting a backslash in front of it will
make it a reference to an array instead.

    mail => [EMAIL PROTECTED]

Type 'man perlref' to get a better understanding of references.

Cheers,

Chris

Reply via email to