From: Yann R. <at...@at...> - 2000-08-26 19:34:08
|
Hi, Using the following code snippet under Net::LDAP 0.19 worked fine, but once I went to 0.20, it broke, and is now returning an array??? Is there something wrong with my code? $ref is the DN, and $field is usualy 'cn' or 'uidnumber', both of which exist. sub get_user_var { my ($self, $ref, $field) = @_; my $mesg = $self->{LDAP}->search ( base => $ref, filter => "(objectclass=*)" ); my @entries = $mesg->entries; if (!@entries) { return; } my $entr = $entries[0]; my @entry = $entr->get($field); my $e = $entry[0]; return $e; } -- -------------------------------------------------------------------- Yann Ramin at...@at... Atrus Trivalie Productions www.redshift.com/~yramin Monterey High IT www.montereyhigh.com ICQ 46805627 AIM oddatrus Marina, CA IRM Developer Network Toaster Developer SNTS Developer KLevel Developer (yes, this .signature is way too big) "All cats die. Socrates is dead. Therefore Socrates is a cat." - The Logician THE STORY OF CREATION In the beginning there was data. The data was without form and null, and darkness was upon the face of the console; and the Spirit of IBM was moving over the face of the market. And DEC said, "Let there be registers"; and there were registers. And DEC saw that they carried; and DEC seperated the data from the instructions. DEC called the data Stack, and the instructions they called Code. And there was evening and there was a maorning, one interrupt... -- Rico Tudor William Safire's Rules for Writers: Remembe |