随笔分类 -  perl5/6 网络编程学习

perl发送post数据
摘要:把post数据写进一个匿名数组里就行 或 或 如果用最后一个方法, 记得要带有content_type头才行 阅读全文

posted @ 2017-02-26 22:25 Perl6 阅读(1222) 评论(0) 推荐(0)

url编码模块
摘要:1 use LWP::SImple; 2 use URI::Escape; 3 encoded_string = uri_escape(raw_string); 4 get(encoded_string); 阅读全文

posted @ 2017-02-26 22:03 Perl6 阅读(172) 评论(0) 推荐(0)

第一章: 文件句柄转化为 typeglob/glob 与文件句柄检测
摘要:1 #为了使在子例程中传递文件句柄不出问题 2 #我们要把文件句柄转为glob或typeglob 3 4 5 #转为glob 6 $fd = *MY_FILE; 7 8 #转为typeblog 9 $fd = \*MY_FILE; 10 11 #两种形式都行, 但\*MY_FILE更安全, 一般都用这个形式 12 13 14 15 #传递给子程序 16 hello... 阅读全文

posted @ 2017-02-22 08:19 Perl6 阅读(245) 评论(0) 推荐(0)

第一章:设置无缓冲
摘要:1 #用select, 要先select一个句柄, 用完后记得select回原来的 2 open FILE, ">log.txt"; 3 select FILE; 4 $| = 1; 5 #$|为true时设置FILE为无缓冲 6 print FILE "The log file data"; 7 #print "The log file data"; 8 select STDO... 阅读全文

posted @ 2017-02-21 15:08 Perl6 阅读(257) 评论(0) 推荐(0)

一个基于时间注入的perl小脚本
摘要:关键是time获得时间 阅读全文

posted @ 2017-02-20 15:00 Perl6 阅读(839) 评论(7) 推荐(1)

第一章:read/sysread/print/syswrite区别
摘要:1 use strict; 2 use warnings; 3 4 5 #将读入的内容添加到原字符串后面 6 my $buffer='START:'; 7 my $byts = sysread(STDIN,$buffer, 10, length($buffer)); 8 #my $byts = read(STDIN,$buffer, 10, length($buffer));... 阅读全文

posted @ 2017-02-19 22:33 Perl6 阅读(569) 评论(0) 推荐(0)

第一章:获取服务器服务banner
摘要:1 #!c:\\perl\\bin\\perl.exe 2 #读取服务器的首行(banner) 3 4 use IO::Socket; 5 6 my $service = '121.201.67.177:ssh'; 7 my $remove = IO::Socket::INET->new($service); 8 my $banner = ; 9 print $banner;#注意这个ban... 阅读全文

posted @ 2017-02-19 21:58 Perl6 阅读(1749) 评论(0) 推荐(0)

第一章:读取文件一行IO::File
摘要:1 #!c:\\perl\\bin\\perl.exe 2 use IO::File; 3 #读取一行 4 my $fd = IO::File->new('perl.txt'); 5 my $one_line = ; 6 print $one_line; 7 $fd->close; 8 9 #写入数据 10 my $wfd = IO::File->new(">> readme... 阅读全文

posted @ 2017-02-19 21:44 Perl6 阅读(1148) 评论(0) 推荐(0)

导航