On 26 Jul 2013, at 13:08, Dileep S <dil...@citrusinformatics.com> wrote:
> > Hi, > I am new to perl scripting. > > I have downloaded perl-ldap-0.57 from http://ldap.perl.org/ > > What should I have to do with the extracted perl-ldap-0.57.tar.gz > > Where Should I have to copy or how install ? You should build and install it like any other perl module. This may help: <http://www.thegeekstuff.com/2008/09/how-to-install-perl-modules-manually-and-using-cpan-command/> > > I have sample App that have the following code > > > use Net::LDAP; > > my $ldap_host = "ldap://192.168.1.161"; > > # Connect to LDAP proxy and authenticate > 27: my $ldap = Net::LDAP->new($ldap_host) || die "Can't connect to > server\n"; > 28: $ldap->bind($ldap_bind_dn, password => $ldap_bind_pass) || die > "Connected to server, but couldn't bind\n"; NB that is not a valid way to check for a bind failure. It is quite a common mistake! You should do something like this instead: $res = $ldap->bind($ldap_bind_dn, password => $ldap_bind_pass); die "Connected to server, but couldn't bind\n" if $res->code; Chris