02 2017 档案

perl中的lock
摘要:1 #!/usr/bin/env perl -w 2 use strict; 3 use threads; 4 use threads::shared; 5 6 my $count:shared = 1; 7 print "count的起始值为:$count\n"; 8 sub th_lock{ 9 $count++; 10 print "已把... 阅读全文

posted @ 2017-02-27 00:03 Perl6 阅读(400) 评论(0) 推荐(0) 编辑

多线程中的变量共享
摘要:1 use threads; 2 use threads::shared; 3 my $count:shared = 1; 4 print "主线程中count为:$count\n"; 5 6 sub thread1{ 7 print "线程1增加1\n"; 8 $count++; 9 print "在线程1中结果为:$coun... 阅读全文

posted @ 2017-02-26 23:34 Perl6 阅读(1131) 评论(0) 推荐(0) 编辑

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

posted @ 2017-02-26 22:25 Perl6 阅读(1220) 评论(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 阅读(169) 评论(0) 推荐(0) 编辑

Mojo_1_第一个简单例子
摘要:可以这样运行: morbo script.pl 阅读全文

posted @ 2017-02-26 09:08 Perl6 阅读(297) 评论(0) 推荐(0) 编辑

php中的__call()函数重载
摘要:结果: 阅读全文

posted @ 2017-02-24 11:09 Perl6 阅读(382) 评论(0) 推荐(0) 编辑

php中使用static方法
摘要:1 <?php 2 3 class Char{ 4 public static $number = 0; 5 public static $name; 6 7 function __construct($what){ 8 self::$name = $what; 9 } 10 public stat 阅读全文

posted @ 2017-02-24 08:42 Perl6 阅读(1007) 评论(0) 推荐(0) 编辑

php中类的static变量使用
摘要:1 name = $what; 11 } 12 function Join(){ 13 self::$number++; 14 echo self::$number," Is :",$this->name,""; 15 } 16 17 } 18 19 $test = range('a','z'); 20 foreach($te... 阅读全文

posted @ 2017-02-24 08:19 Perl6 阅读(900) 评论(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 阅读(243) 评论(0) 推荐(0) 编辑

perl登录ssh
摘要:挺好用的, 用法没有太复杂 阅读全文

posted @ 2017-02-22 05:29 Perl6 阅读(1206) 评论(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 阅读(253) 评论(0) 推荐(0) 编辑

perl输出重定向
摘要:先把A重定向到STDOUT, 之后的STDOUT不代表标准输出了 到最后用完了再恢复 阅读全文

posted @ 2017-02-21 14:47 Perl6 阅读(1972) 评论(0) 推荐(0) 编辑

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

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

perl 在win下输出中文乱码问题
摘要:1 use utf8; 2 my $name = '你好'; 3 binmode(STDOUT, ":encoding(gbk)"); 4 print $name,"\n"; 5 6 # #或 7 # use Encode; 8 # my $str='你好'; 9 # $str = encode("gbk", decode("utf-8", $str)); 10 # prin... 阅读全文

posted @ 2017-02-19 23:18 Perl6 阅读(1803) 评论(0) 推荐(0) 编辑

第一章: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 阅读(541) 评论(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 阅读(1743) 评论(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 阅读(1141) 评论(0) 推荐(0) 编辑

测试一个注入小脚本
摘要:主要是猜测当前数据库名称 阅读全文

posted @ 2017-02-18 07:39 Perl6 阅读(466) 评论(0) 推荐(0) 编辑

perl 列出一个目录下的文件的大小
摘要:1 use strict; 2 use warnings; 3 use Cwd; 4 my $dir = 'd:\\www'; 5 chdir($dir); 6 opendir DIR, $dir or die "Cannot open dir:$!\n"; 7 my %result; 8 while(my $filename = readdir(DIR)){ 9 ne... 阅读全文

posted @ 2017-02-17 06:20 Perl6 阅读(1050) 评论(0) 推荐(0) 编辑

如何用CMD开启3389与查看3389端口
摘要:开启 查端口 注意: Terminal与Server之间有且只有一个空格。双引号为英文的双引号 阅读全文

posted @ 2017-02-16 05:40 Perl6 阅读(22255) 评论(0) 推荐(1) 编辑

导航

点击右上角即可分享
微信分享提示