BigJoe has asked for the wisdom of the Perl Monks concerning the following question:
This works fine on Linux RH7 but on winNT it errors on the "$entr->get_value" so I remove the _value and run it. On both systems it gives me this output:#!/usr/bin/perl use Net::LDAP qw(:all); $ldap = Net::LDAP->new('pluto') or die "$@"; $ldap->bind; # an anonymous bind my $base = "c=us"; my @Attrs = (); my $gettem = "harnish"; $result = LDAPsearch($ldap,"sn=" . $gettem,\@Attrs); @entries = $result->entries; foreach $entr (@entries) { $phone = $entr->get_value('telephoneNumber'); $user = $entr->get_value('cn'); $email = $entr->get_value('mail'); print "$user\n"; print "$email\n"; print "$phone\n"; } undef @selected; $ldap->unbind; # take down session sub LDAPsearch { my ($ldap,$searchString,$attrs) = @_ ; my $result = $ldap->search ( base => "$base", scope => "sub", filter => "$searchString", attrs => $attrs, sizelimit => $size_limit ); }
Any Ideas? ThanksARRAY(0x1f6b378) ARRAY(0x1f6aa70) ARRAY(0x1f6ad7c)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::LDAP on NT
by chromatic (Archbishop) on Dec 15, 2000 at 04:37 UTC | |
by BigJoe (Curate) on Dec 16, 2000 at 00:34 UTC |