stupid problem with Net::LDAP

2007-12-20 Thread J.I. Asenjo
hi, I have this snippet: #!/usr/bin/perl use strict; use warnings; my $ldapserver = "127.0.0.1"; my $basedn = "dc=asenjo,dc=nx"; search("car","mail"); sub search { use Net::LDAP; my $ldap = Net::LDAP->new($ldapserver) or die "$0"; # at home I do not need binding, otherwise here bind my $msg =

RE: stupid problem with Net::LDAP

2007-12-20 Thread Don C. Miller
J.I. the parent while loop/for loop is not the reason the second version works and the first does not. The solution is in the line: print "$_\n" for $entry->get_value( "$_[1]" ); # this will work in either loop get_value returns an array in a list context or the first attribute in a scalar contex