![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
perl
文章平均质量分 72
jiangredsheep
这个作者很懒,什么都没留下…
展开
-
perl程序被网友狠批,呵呵,爽!
发信人: jiangfei (afei), 信区: Perl标 题: 特殊符号的匹配问题发信站: 水木社区 (Sun Jun 26 11:07:12 2005), 转信我想把每个词后面的词性信息去掉(/xxx形式)词性信息中可能有各种各样非字字符而且必须对应词性表去删除(词性表中有的词性信息才可删除)我下面的程序先定义词性表,然后对文件中每句话匹配删除,可是例子中的/prep$ 和/m(vari原创 2005-06-27 14:21:00 · 1453 阅读 · 0 评论 -
How to use next and last in Perl
next skips to the next evaluation of the loopWhen you use next in Perl, you skip to the next evaluation of the current loop. In other words, if the loop is nested within another control structure, nex原创 2005-11-22 15:24:00 · 3440 阅读 · 0 评论 -
perl 中一些常用的正则匹配
下面是正则表达式中的一些常用模式。 /pattern/ 结果 . 匹配除换行符以外的所有字符 x? 匹配 0 次或一次 x 字符串 x* 匹配 0 次或多次 x 字符串,但匹配可能的最少次数 x+ 匹配 1 次或多次 x 字符串,但匹配可能的最少次数 .* 匹配 0 次或一次的任何字符 .+ 匹配 1 次或多次的任何字符 {m} 匹配刚好是 m 个 的指定字符串 {m,n} 匹配在 m个 以上 n原创 2006-01-14 14:30:00 · 6123 阅读 · 1 评论 -
Perl getopts Howto--如何使用perl中的getopts
Perl getopts HowtoThis howto comes with no guaratees other than the fact that these code segments were copy/pasted from code that I wrote and ran successfully.<!--.pod PRE {background : #e原创 2006-01-18 19:33:00 · 5332 阅读 · 0 评论 -
为译文信息打分的程序
#!usr/bin/perl #use strict; # always use strict, its a good habit####### Intromy ($date, $time) = date_time_stamp();print "MT evaluation run on $date at $time/n";print "command line: ", $0, "原创 2006-02-18 19:37:00 · 1264 阅读 · 2 评论 -
perl links
http://www.roth.net/perl/links/Win32 Perl LinksWith so much information on Perl available on the Internet it can be quite difficult to find exactly what you are looking for. This is why we have c转载 2006-08-22 13:45:00 · 1027 阅读 · 0 评论 -
Perl书单
发信人: Fang (寒窗萤雪), 信区: Physics标 题: Perl书单发信站: 大话西游站 (2004年02月18日21:45:57 星期三), 站内信件学习perl两年,读书甚多,推荐几本:1. Programming Perl, Larry Wall et al, 3nd Ed不记得谁说的了,直接读大师的著作,而不要读大师学生的著作(所以大师学生最好不要写书了)。2. Perl C转载 2006-08-06 16:14:00 · 1712 阅读 · 0 评论 -
perl new gots
1. "@"当作数组缘于array首字母哦,标量呢?"$"当然是scalar了。2. "=>"是comma(,)的同义词哦,所以不要以为"=>"只用于hash! @array = (1,2=>3=>4=>5); print "@array"#amazing,output:1 2 3 4 53. 要输出一个数组,那么如何分隔开数组元素呢? print join("/n",@arr原创 2006-12-24 09:22:00 · 2286 阅读 · 0 评论 -
perl sort
sortPerl functions A-Z | Perl functions by category | The 'perlfunc' manpagesort SUBNAME LISTsort BLOCK LISTsort LISTIn list context, this sorts the LIST and returns the sorted转载 2011-12-01 10:07:10 · 1476 阅读 · 0 评论 -
perl按照字符串长度进行排序,sort函数的示例
## rank by lenprint join("\n",sort sort_by_len keys %chn_hash);sub sort_by_len{if(length($a) length($b)) {1} else {0}}原创 2012-09-05 10:02:55 · 2103 阅读 · 0 评论 -
perl的hash of hash 最便于一对多对应的处理
假设一个文件里面,每行格式为:中文单词;英文单词但是,全部行可能重复,也可能英文单词不一样,如果想方便地整理出所有中文单词的候选英文单词,用hash of hash最方便。看下面的例子,英文候选\t分割。my %chn_eng_hash = ();while(){chomp();my ($chn,$eng) = split(/\;/);$chn =~原创 2012-09-10 16:00:19 · 2006 阅读 · 0 评论 -
perl中的命令行开关用法
功能丰富的 Perl: 编写说英语的 Perl 程序内容:随功能一起发展的很棒的用户界面用传统的 Unix 方式创建的简单用户界面简单的事件循环Parse::RecDescent 的快速教程使用 Parse::RecDescent 的简单用户界面使用 Parse::RecDescent 的复杂用户界面Parse::RecDescent:功能强大、易于使用和可修改的模块参考资料 关于作者对本文的评价原创 2005-11-22 15:31:00 · 2643 阅读 · 0 评论 -
perl的foreach赋值是引用
这个程序将会把@a数组中所有的元素先逐个引用给$counter,然后把$counter地值打印出来。注意,我这里说得是引用,不是赋值,perl里面的“=”实际上是在进行引用,而不是赋值,这是需要同c严格区分的。下面的例子好玩,看一看: #!/user/bin/perl -w use strict; { my @a=(1..10); my $counter; foreac原创 2005-11-22 14:51:00 · 3852 阅读 · 2 评论 -
Ten Essential Development Practices
http://www.perl.com/pub/a/2005/07/14/bestpractices.htmlThe following ten tips come from Perl Best Practices, a new book of Perl coding and development guidelines by Damian Conway.1. Design the Module原创 2005-07-16 19:48:00 · 2068 阅读 · 0 评论 -
perl文本处理总结[2]
7. 文件成行读入 把一个文件读入一个字符串方法: my $contents;{ local $/; $contents = ;}或my $contents = do {local $/; }例子: 文件中以空行为语块分割的标记,把语块内部顺序保留,而语块间逆序输出。#!open IN,"input.txt";open OUT,">output.txt";my $contents;{原创 2005-09-17 10:06:00 · 4424 阅读 · 0 评论 -
perl embeded into c++
发信人: wideexpress (冬瓜), 信区: Perl标 题: 菜鸟历程——将perl嵌入到vc++发信站: 水木社区 (Sat May 28 23:36:25 2005), 站内因为要在vc环境下进行文本解析,所以想将perl嵌入到vc环境中来,在网上看到ActivePerl支持Windows环境,于是下了ActivePerl5.8.6,安装之后将环境变量和库文件设好,就可以在dos下原创 2005-05-29 10:22:00 · 1777 阅读 · 0 评论 -
标 题: (zz)Perl Puzzles
标 题: (zz)Perl Puzzles发信站: 水木社区 (Sat May 21 01:21:09 2005), 转信http://www.mathdogs.com/people/mkc/perl-puzzles.htmlPerl PuzzlesWhen discussing the relative merits of Python versus Perl, one argument I原创 2005-06-07 14:08:00 · 1155 阅读 · 0 评论 -
key to perl puzzles(from smth)
1. What does this do? $foo = $foo[1] 将数组 @foo 的第2个元素赋给标量 $foo 2. What does this print? @a = (); $h{a} = b; push @a, %h; print "@a"; push 的参数除了第 1原创 2005-06-07 14:11:00 · 1189 阅读 · 0 评论 -
Perl Puzzles Key(standard)
Perl Puzzles KeyThis is the key for the Perl puzzles. Corrections welcome. Answerscredit for noting that the two foos are unrelated. a b c and 3 $a is set to the eight character string consisting of原创 2005-06-07 15:22:00 · 1023 阅读 · 0 评论 -
perl embeded into c++ 完全攻略
perl embeded into c++document.title="perl embeded into c++ - "+document.title 完全攻略 step 1:要想在Microsoft Developer Studio中使用perl首先要运行:perl -MextUtils::Embed -e xsinit生成perlxsi.c(perlxsi.cpp)文件.Step2原创 2005-06-07 15:43:00 · 1653 阅读 · 1 评论 -
perl文件读取之心得
在perl中用到的读文件一般有两种方法:1.先把整个文件download到一个数组里面然后对数组进行遍历操作。如:open (IN,"alignresult.txt") ||(die "can not open the file input.txt/n$!");my @all = ;foreach $line(@all){process $line;}或者foreach $line(){...}语原创 2005-06-08 11:35:00 · 6731 阅读 · 0 评论 -
显示led 数字的perl程序
#!/usr/bin/perl -wuse strict;open FONT, "font.txt";chomp(my @font = );close FONT;my @led = map { s/(.{4})/$1,/g; split /,/ } @font;chomp(my $num = my @n = split //, $num;for (0..6) { for my $n(@n)原创 2005-11-05 15:37:00 · 1012 阅读 · 0 评论 -
perl 文档查询方法总结[不断更新]
1. 查模块,用ppm吧2.查函数 perldoc.bat -f [function]3. 查操作符及优先级 perldoc perlop4. ..郁闷,记不起来了,perldoc自己看去吧C:/>perldoc -hperldoc [options] PageName|ModuleName|ProgramName...perldoc [options] -f BuiltinFunction原创 2005-11-18 14:39:00 · 1291 阅读 · 0 评论 -
perl内置变量总结【怒了,每次都得搜,堆在这里放着备查】
一、正则表达式特殊变量:1、$n :包含上次模式匹配的第n个子串2、$& :前一次成功模式匹配的字符串3、$` :前次匹配成功的子串之前的内容4、$’ :前次匹配成功的子串之后的内容5、$+ :前一次使用括号的模式匹配的字符串.二、文件句柄特殊变量:1、$| :如果设置为零,在每次调用函数write或print后,自动调用函数fflush,将所写转载 2012-09-18 16:45:39 · 911 阅读 · 0 评论