惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
J
Java Code Geeks
雷峰网
雷峰网
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
云风的 BLOG
云风的 BLOG
V
Visual Studio Blog
V
Vulnerabilities – Threatpost
S
Securelist
The Hacker News
The Hacker News
The Register - Security
The Register - Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Help Net Security
Help Net Security
G
Google Developers Blog
Hugging Face - Blog
Hugging Face - Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
M
MIT News - Artificial intelligence
AI
AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The GitHub Blog
The GitHub Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Schneier on Security
Schneier on Security
N
Netflix TechBlog - Medium
T
The Blog of Author Tim Ferriss
Google DeepMind News
Google DeepMind News
Hacker News - Newest:
Hacker News - Newest: "LLM"
H
Hacker News: Front Page
博客园 - 司徒正美
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
B
Blog
Microsoft Azure Blog
Microsoft Azure Blog
大猫的无限游戏
大猫的无限游戏
Security Latest
Security Latest
Engineering at Meta
Engineering at Meta
N
News and Events Feed by Topic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Threat Research - Cisco Blogs
U
Unit 42
V
V2EX
V2EX - 技术
V2EX - 技术
L
LINUX DO - 最新话题
aimingoo的专栏
aimingoo的专栏
Microsoft Security Blog
Microsoft Security Blog
Recorded Future
Recorded Future
P
Privacy & Cybersecurity Law Blog
美团技术团队
小众软件
小众软件
F
Fortinet All Blogs

博客园 - zhumao-2

perl将json转换成xml cnblogs终于把以前内容的管理权还给我了~ 曙光服务器千兆光纤网卡安装 关于DBI->connect ($dsn, $db_user, $db_pass, { RaiseError =>1, PrintError => 0}) - zhumao-2 RichCopy 3.5 过期?自己想办法~ 将linux密码存储到OpenLDAP里面=OpenLDAP Everywhere Revisited C语言操作OpenLDAP 心得共享:Oracle经验技巧集锦 [From CU] 使用Perl生成usmarc记录 牛郎织女 Perl中的trim函数 在 Perl 中使用内联 perl中的特殊内置变量(转) 从网页中提取链接(转载) 在指定文件夹中的文件中查找包含指定字符的行(这个小东西不错[Perl]) 打开.bz2文件 Windows 能干而 Linux 干不了的事情,那就是不需要干的事情 Linux下用Perl产生新的EXCEL文档 RPM包强制删除
Perl操作OpenLDAP(未测试)
zhumao-2 · 2005-08-13 · via 博客园 - zhumao-2

Perl接口

  Perl 的NET::LDAP模块中包括有完整的LDAP目录访问函数,只要安装NET::LDAP就可以完成正常的LDAP目录访问;但在安装NET::LDAP模块前,必须先安装Convert::ASN1模块,该模块可以从CPAN下载。

  例:

#!/usr/bin/perl

use warnings;

use strict;

use Net::LDAP;

use Net::LDAP::Util qw(ldap_error_text);

my $server = "localhost";

my $ldap = new Net::LDAP($server) ||

  die("failed to connect to server.$!\n");

my $mesg = $ldap->bind("cn=Manager,dc=daifu,dc=com", password => "secret");

die ("bind failed with ",ldap_error_text($mesg->code()),"\n")

  if $mesg->code();

$mesg = $ldap->search(base => "dc=daifu,dc=com", scope => "sub",

  filter => "sn=*",);

die ("search failed with ",ldap_error_text($mesg->code()),"\n")

  if $mesg->code();

print "Count is ",$mesg->count(),"\n";

while (my $entry = $mesg->shift_entry()) {

  print "dn:",$entry->dn(),"\n";

  for my $attr($entry->attributes()) {

     for my $val($entry->get_value($attr)) {

        print "$attr:$val\n";

     }

  }

  print "\n";

}

操作过程实际上与C和JAVA是一样的。