How to integrate LDAP in Perl?

来源:互联网 发布:安安软件站官网 编辑:程序博客网 时间:2024/05/14 23:37

If you try to use LDAP by adding "use Net::LDAP;"in your Perl script by you didn't have LDAP installed, you may probably get the following similar errors:

C:\Rebecca\script\perl>perl status.pl

Can't locate Net/LDAP.pm in @INC (you may need to installtheNet::LDAP module) (@INC contains: C:/Perl64/site/lib C:/Perl64/lib .) atstatus.plline 4.

 

How to to do here? ---- You need to install the LDAP module.

Step1: Download "perl-ldap-0.64.tar" from http://ldap.perl.org/

Step2: check @INC by "perl –v", you may get like in the end of the result:

@INC:

  C:/Perl64/site/lib

  C:/Perl64/lib

Step3: Copy the folders in perl-ldap-0.64\lib to either of the folder mentioned in @INC

Step4: Check if you already have it:

C:\Rebecca\script\perl>perldoc Net::LDAP

(if the following usage is shown, it means you already haveit installed)

NAME

    Net::LDAP-Lightweight Directory Access Protocol

SYNOPSIS

     use Net::LDAP;

after installing LDAP, run the script again, you can see thereare also some errors:

C:\Rebecca\script\perl>perl status.pl

Can't locate Convert/ASN1.pm in @INC (you may need toinstall the Convert::ASN1

BEGIN failed--compilation aborted atC:/Perl64/site/lib/Net/LDAP.pm line 12.

Compilation failed in require at status.pl line 4.

BEGIN failed--compilation aborted at status.pl line 4.

 

So you need to install Convert module as well

Step5: Download “Convert-ASN1-0.27.tar” from http://search.cpan.org/~gbarr/Convert-ASN1-0.27/lib/Convert/ASN1.pod

Step6: Copy the folder under Convert-ASN1-0.27\lib to C:/Perl64/site/libas well.


For more information, could be got from https://metacpan.org/pod/Net::LDAP::FAQ


0 0
原创粉丝点击