随笔分类 - Perl
摘要:In this article, let us discuss how to write Perl socket programming using the inbuilt socket modules in Perl.Perl socket modules provides an object i...
阅读全文
摘要:业务需要针对某文件进行判重操作,用Perl实现如下#!/usr/bin/perlmy %h;s/\s+$// and $h{$_}++ while ;print "$_ $h{$_}\n" for sort { $h{$b} $h{$a} } keys %h;使用效果, 打印出每种行数据的重复次数,例如用它来统计一下弱密码使用频度[admin@centos bin]$ perl checkRepeat.pl a | more123456789 23503212345678 21275111111111 76346dearbook 4590200000000 34953123
阅读全文
摘要:http://hellosa.blog.51cto.com/2698675/572004http://www.ibm.com/developerworks/cn/linux/sdk/perl/culture-8/
阅读全文
摘要:Installing Wordnet::Similarity on WindowsToday I had the task of getting Wordnet::Similarity working for a project I'm involved in. Getting it to work on Windows is not straight forward, there appears to be a makefile issue Wordnet::QueryData.Here's a quick guide for those of you who don'
阅读全文
摘要:$cond =~ s/\[COL\:([\w_]+)\]/\$\$phash_msg\{\"$1\"\}/ig;my %hashMessage = $oldMsg =~ /(\w+)=\'([^\']*)\'/g;perl -e "print crypt ('blah','iv');"
阅读全文
摘要:在论坛上看到的,觉得蛮实用,总结出来分享一下[Windows版]:在_vimrc中做一个键的映射,map <SPACE>t <ESC>:!perl %<CR>将"空格 + t" 映射成调试perl程序的动作,这样可以不必退出Perl即运行程序如图:[Linux版]:用 Ctrl-z 然后向上方向键调出历史命令,然后 fg 恢复 vim
阅读全文
摘要:Perl中的@INC变量用于指定Perl module的查找路径。如:$VAR1 = '../lib';$VAR2 = '/opt/perl/lib/5.8.3/sun4-solaris-thread-multi';$VAR3 = '/opt/perl/lib/5.8.3';$VAR4 = '/opt/perl/lib/site_perl/5.8.3/sun4-solaris-thread-multi';$VAR5 = '/opt/perl/lib/site_perl/5.8.3';$VAR6 = '/op
阅读全文
摘要:刚查了一下Time::HiRes的用法:它一般用来确定运行某个任务的所需的时间。 如: use Time::HiRes qw(gettimeofday tv_interval); my $start_time = [gettimeofday]; my $counter=0; foreach (1..1000){ $counter++; } my $interval=tv_interval($start_time,[gettimeofday]); print “it take the time :...
阅读全文

浙公网安备 33010602011771号