![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
perl语言
文章平均质量分 88
惹不起的程咬金
这个作者很懒,什么都没留下…
展开
-
Perl chomp
<br />如果字符串结尾有换行符,chomp 可以去掉它。这基本上就是它能完成的所有功能,如下例:<br />$text = “a line of text/n”; #也可以由<STDIN>输入<br />chomp($text); #去掉换行符(/n)。<br />它非常有用,基本上你的每一个程序都会用到它。如你将知道,这是将字符串末尾换行符去掉的最好方法。基于Perl 中的一条基本原则:在需要使用变量的地方,可以使用赋值表达式来代替。我们有更简单的使用chomp 的方法。Per转载 2010-07-20 12:49:00 · 2057 阅读 · 0 评论 -
TK之button
分为三种类型: Button,CheckButton,RadioButton. Button:The -text option lets the user know what the Button is for, and the -command option makes something happen when the user clicks the Button. Checkbuttons:Using -variable gives you an easy way to f原创 2011-03-21 10:38:00 · 3178 阅读 · 1 评论 -
Listbox
-background =>colorSets the color of the area behind the text. -borderwidth =>amountSets the width of the edges of the widget. Default is 2. -cursor =>cursornameSets the cursor to display when the mouse is over the Listbox. -exportselection =>原创 2011-03-21 16:07:00 · 1140 阅读 · 1 评论 -
Perl中grep的用法:
<br />主要缘由是今天看代码的时候看到了grep,自己不是很熟悉,学习下<br /><br />先看grep中的文档:<br /> * grep BLOCK LIST<br /><br /> * grep EXPR,LIST<br /><br /> This is similar in spirit to, but not the same as, grep(1) and its relatives. In particular, it is not limited原创 2011-05-16 12:53:00 · 11740 阅读 · 0 评论 -
ulink,mkpath,rmtree
perl中的unlink: * unlink Deletes a list of files. On success, it returns the number of files it successfully deleted. On failure, it returns false and sets $! (errno): 1. my $unlinked = unlink 'a', 'b', 'c'; 2. unlink原创 2011-05-16 13:53:00 · 1699 阅读 · 0 评论 -
Java,Perl,Python 比较
近期打算好好学习Perl,Python和Java,可是Java只了解这些纯java的东西,什么EJB之类的不在兴趣范围之类,就跳过了。一直在想需要从哪些方面进行比较学习,网上刚好找到几篇英文的比较的。先把我感兴趣的写在下面,在后面的文章中就按照这个思路慢慢学习吧。(有些内容可能不原创 2011-09-29 14:10:08 · 8366 阅读 · 0 评论 -
Perl 与 Python 之间的一些异同
关于 Perl 与 Python 的起源和特点Perl 是 Practical Extraction and Report Language 的简称,由 1987 年 Larry Wall 创建,最初的目的是为了在 UNIX 上方便处理报表,经过长期的发展已经成为一种全功能的转载 2011-10-12 16:07:42 · 1138 阅读 · 0 评论 -
Perl 使用引用来访问hash 数组
工作中遇到的一个问题,函数返回的是一个hash数组的原创 2014-08-15 16:55:23 · 4517 阅读 · 0 评论 -
Perl CGI 学习之环境搭建-Windows7 64
下载:http://download.cnet.com/Apache-Tomcat-64-bit/3000-10248_4-75812427.html原创 2015-03-09 14:57:18 · 2621 阅读 · 0 评论 -
Tk之Label and Entry Widgets
<br />Label常见的参数:-anchor => 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w' | 'nw' | 'center'Causes the text to stick to that position in the Label widget. This won't be obvious unless the Label is forced to be larger than standard size. -background =原创 2011-03-21 13:00:00 · 1710 阅读 · 3 评论 -
Perl/tk之font
<br />1.pack is the most commonly used<br /> 2.The grid geometry manager has been improved greatly with the release of Tk 8.0 and subsequent porting to Perl. <br />3.The place geometry manager is the most tedious to use, because you have to deter原创 2011-03-21 10:18:00 · 2168 阅读 · 1 评论 -
perl 发送邮件
<br />用到的库:Net::SMTP;这个可以在cpan上找得到。<br />另外在windows下安装perl的库可以使用ppm方法。<br />在command line里面输入ppm会出现Perl Package Manager。<br />找到你所需要安装的库选择“File”->"Run task"就可以了。<br /> <br />看个发送邮件的简单例子:<br />sub SendEmail($$){<br /> my $emailfrom="";<br /> my ($to原创 2011-02-23 17:07:00 · 1234 阅读 · 0 评论 -
hash结构
perl中数组与哈希的差别是:哈希是按照名字来访问它们的标量的,而不是像数组那样使用数字标号进行访问。hash的定义用%,数组的定义用@。 对hash结构进行赋值:%author;$author{anne}=franker 逗号箭头运算符,即= >;利用;箭头对hash进行初始化:%food=(apple=>fruit,pear=>fruit原创 2010-05-24 14:47:00 · 1626 阅读 · 0 评论 -
perl中的hash结构
perl中数组与哈希的差别是:哈希是按照名字来访问它们的标量的,而不是像数组那样使用数字标号进行访问。hash的定义用%,数组的定义用@。 对hash结构进行赋值:%author;$author{anne}=franker 逗号箭头运算符,即= >;利用;箭头对hash进行初始化:%food=(apple=>fruit,pear=>fruit原创 2010-05-24 15:01:00 · 1655 阅读 · 0 评论 -
perl中的引用
引用的基本概念: 所谓引用,它只是指向一组数据的指针,并不包含实际数据的本身。该引用通常存放在另一个标量变量中。若要创建对某个既定变量的引用,可以在该变量的前面加上一个反斜杠例如: my $test="it is a reference"; my $ref=/$test;如果需要输出引用,则需要$$,注意如果直接$ref,输出的实际相当原创 2010-05-24 15:39:00 · 819 阅读 · 1 评论 -
perl中的hash结构
perl中数组与哈希的差别是:哈希是按照名字来访问它们的标量的,而不是像数组那样使用数字标号进行访问。hash的定义用%,数组的定义用@。 对hash结构进行赋值:%author;$author{anne}=franker 逗号箭头运算符,即= >;利用;箭头对hash进行初始化:%food=(apple=>fruit,pear=>fruit原创 2010-05-24 14:54:00 · 673 阅读 · 0 评论 -
perl中的数据结构
1 给列表和引用赋值# 给一个数组赋予一个数组引用列表。 @Aoa = ( ["fred", "barney" ], ["george", "jane", "elroy" ], ["homer", "marge", "bart" ], ); print $Aoa[2][1]; # 打印 "marge"原创 2010-05-25 10:02:00 · 1232 阅读 · 0 评论 -
perl:散列的数组和散列的散列
1 散列的数组:初始化:@AoH = ({ husband => "barney", wife => "betty", son => "bamm bamm", },{ husband => "george", wife => "jane", son原创 2010-05-25 10:11:00 · 4959 阅读 · 0 评论 -
perl实现excel画图和写文件
需要用到的包:Win32::OLE;Win32::OLE::Const Microsoft Excel;这些包可在CPAN上找到 例子:my $Excel = Win32::OLE->new("Excel.Application");$Excel->{Visible} = 0; #打开一个现成的文件(你可以用对应的文件替换掉F://perl_exa原创 2010-05-25 13:44:00 · 1942 阅读 · 0 评论 -
perl实现excel画图和写文件
需要用到的包:Win32::OLE;Win32::OLE::Const Microsoft Excel;这些包可在CPAN上找到 例子:my $Excel = Win32::OLE->new("Excel.Application");$Excel->{Visible} = 0; #打开一个现成的文件(你可以用对应的文件替换掉F://perl原创 2010-05-26 08:56:00 · 2415 阅读 · 0 评论 -
RabbitMQ message bus的安装和入门
下载地址:http://www.rabbitmq.com/tutorials/tutorial-one-python.html在windows上试的,安装server之前需要下载:http://www.erlang.org/download.html原创 2015-12-30 14:52:03 · 1700 阅读 · 0 评论