Ciao

Are you sure you really ran that script?

Alessandro Favretto wrote:
This is the simplest script i tested.
------------------------------------------------------------------
#!/usr/bin/perl

use Net::LDAP qw(:all);

$ldap = new Net::LDAP('ldapserver.domain.com') or die "$@";
$ldap->bind( version => 3 );
@attrs = ['uniqueMember'];
--^^^^^^^^^^^^^^^^^^^^^^^^^^

This will work, but isn't really doing what you want. You probabily want to have this as:

$attrs = ['uniqueMember'] ;
and having attrs => $attrs in the search() call below, or

@attrs = (['uniqueMember']) ;
and having attrs => [EMAIL PROTECTED]

Moreover:

foreach $entry ($mesg->all_entries)
-------------------------^^^^^^^^^^^

all_entries is there for compatibility, you should use entries(). BTW, which version of perl-ldap are you using?

About get_value, are you aware of its behaviour in scalar and list context?

get_value ( ATTR [, OPTIONS ] )
Get the values for the attribute ATTR. In a list context returns
all values for the given attribute, or the empty list if the
attribute does not exist. In a scalar context returns the first
value for the attribute or undef if the attribute does not exist.


Please, post a snippet of _real_ code. I don't know how we could help you if we don't know what the real problem is...

Ciao
--M

--
Marco Marongiu                            Email: [EMAIL PROTECTED]
System Administrator                      Phone: +39 070 460 1684
Tiscali S.p.A.



Reply via email to