Something About Perl

Perl is a high-level , general-purpose,interpreted ,dynamic programming language . It was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier . It borrows features from other programming languages including C , shell scripting , AWK and sed . The language provides powerful text processing facilities without the arbitrary data length limits of many contemporary Unix tools , facilitating easy manipulation of text files .Perl gained wide spread popularity in the late 1990s as a CGI scripting language , in part due to its parsing abilities , and the Perl 6 will be released in the following days .In addition to CGI , Perl is used for graphics programming,system administration , network programming ,finance , bioinformatics , and other applications .

Perl is a general-purpose programming language originally developed for text manipulation , but as of 2010 is used for a wide range of tasks including system administration , web development ,network programming ,games , bioinformatics ,and GUI development . It is intended to be practical(easy to use , efficient , complete) rather than beautiful(tiny ,elegant , minimal ) . Its major features include support for multiple programming paradigms , reference counting memory management ,built-in support for text processing , and a large collection of third-party modules .

The overall structure of Perl derives broadly from C . Perl is procedural in nature , with variables , expressions ,assignment statements ,brace-delimited blocks ,control structures , and subroutines . It also takes features from shell programming . All variables are marked with leading sigils , which unambiguously identify the data type of the variable in context . Importantly , sigils allow variables to be interpolated directly into strings . Perl has many built-in functions that provides tools often used in shell programming such as sorting , and calling on system facilities . As the development of the core language , Perl 5 added features that support complex data structures ,first-class functions , and an object-oriented programming model . These include references , packages,class-based method dispatch , and lexically scoped variables , along with compiler directives. A major additional features introduced with Perl 5 was the ability to package code as reusable modules . To sum up , all version of Perldo automatic data-typing and automatic memory-management . The interpreter knows the type and storage requirements of every data object in the program ;it allocates and frees storage for them as necessary using reference counting .

The design of Perl can be understood as a response to three broad trends in the computer industry : falling hardware costs , rising labor costs , and improvements in compiler technology . It has many features that ease the task of the programmer at the expense of greater CPU and memory requirements . These include automatic memory management ; dynamic typing ; strings , lists , and hashes ; regular expressions ; introspection ;and an eval() function . It follows the theory of "no built-in limits” , and idea similar to the Zero One Infinity rule .

Perl has many and varied applications ,compounded by the availability of many standard and third-party modules . However , it’s often used as a glue language ,typing together systems and interfaces that were not specifically designed to interoperate , and for "datamunging” , that is ,converting or processing large amounts of data for tasks such as creating reports . In additions ,it’s also widely used in finance and in bioinformatics , where it is valued for rapid application development and deployment and for its capability to handle large data-sets .

Besides , Perl is widely favored for database applications . Its text-handing facilities are useful for generating SQL queries ; arrays ,hashes , and automatic memory management make it easy to collect and process the returned data .

时间: 2024-11-02 02:52:16

Something About Perl的相关文章

[ Perl 6 ] 被取代的钻石操作符(<>)

[ Perl 6 ] 被取代的钻石操作符(<>) There is more than one way to do it. Perl 5中,如果要逐行读取一个文件的内容,你可能会写出下面的代码 while (<>) { chomp; print "It was $_ that I saw.\n"; } $ perl myscript.pl in 但是在Perl 6中,钻石操作符<>已经不再被支持,现在可以用下面的代码来完成上面的功能 for line

window-运行perl脚本(搭建health-check环境)

安装vsphere sdk VMware-vSphere-Perl-SDK-5.1.0-780721.exe ##看具体的情况安装对应版本的sdk 修改系统环境变量,将安装路径Perl/bin和Perl/site/bin添加到path变量的后面 cmd到perl脚本目录: perl *.pl  --serrver ip –username name –type vcenter ##vcenter服务器 perl *.pl     --server ip –username name –type

Perl中的真与假

Perl认为真值是自明的(self-evident), 表示任何事物的真值都可以计算.Perl以实用的方式来定义真值,即一个实体的真值取决于这个实体的类型.Perl总是乐观的认为:这个世界上真的东西远比假的东西多的多. Perl区别与任何其他计算机语言,Perl是语言学家创造的,而语言的意思离不开上下文语境,所以Perl中的真值都可以在标量(标量$与数组@类似于英文中的单数与复数, book 与 books的区别, 真值在现实世界中,应该就是单数,所以是标量)计算,除此之外,不会做任何类型的强制

初学正则表达式2(在Perl下使用)

/** * 在Perl下的使用: * #华氏温度和摄氏温度之间的转换功能更加完善 print "请输入要转换的温度,例如:20C/30F\n"; $input = <STDIN>; #获取输入的内容 chomp($input); #去掉文本结尾的换行 if($input =~ m/^([-+]?[0-9]+(\.[0-9]*)?) *([CFcf])$/){ # m/^([-+]?[0-9]+)(\.[0-9]*)?([CFcf])$/等价于: $inputNum = $1

[perl] 连接mysql

先写在这里吧,之后再改进~~ package mysql_conn; use DBI; use strict; sub new{ my $class = shift(); print ("CLASS=$class\n"); my $self={}; $self->{"location"} = shift(); $self->{"db_name"} = shift(); $self->{"db_user"} =

【linux】grep 和【perl】 脚本实现的grep功能的运行时间差异

参考在网上找到的代码,没想到相差那么大,目前有个项目要对50GB~70GB的代码,260个关键字做扫描,急需一个比较快速的方案. [[email protected] stat]$ wc -l 1 234033 1 [[email protected] stat]$ perl 1.pl cost 1 seconds zjtel : 32606 [[email protected] stat]$ perl 2.pl cost 111 seconds zjtel : 32606 1.pl #!/us

Perl语言学习笔记 9 正则表达式处理文本

1.替换 s/PATTERN/REPLACE/; #返回是否替换成功的布尔值 可以使用捕获变量,如:s/(\w)/$1/ 匹配失败则不做任何处理 2.定界符 对于没有左右之分的定界符,重复三次即可,如:s///.s### 对于有左右之分的定界符,需使用两对,一对包含模式,一对包含替换字符串,这两对可以不一样,如:s{}{}.s[]{}.s<>[] 3.可选修饰符 /g可进行全局替换,替换所有匹配到的字符串,如:s/ / /g /s:使得 . 匹配所有字符 /i:大小写无关 4.绑定操作符 $f

How To: Perl TCP / UDP Socket Programming using IO::Socket::INET

http://www.thegeekstuff.com/2010/07/perl-tcp-udp-socket-programming/ 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 interface that makes it easier

3、perl进阶

条件判断与循环结构(if (unless)  while(until) for foreach next last redo) if (unless)  数字关系运算符 关系运算符: 数字关系运算符(>,>=,<,<=,==,!=) 字符串关系运算符(gt,ge,lt,le,eq,ne) 数字中0是假,其余是真:字符中空字符串("")和字符串("0")是假,其余是真:未定义的undef是假. 例子:0.00是假,是0的另一种写法:"

perl面向对象入门之处理json数据和rest api in perl

需求:有些已经实现好的Restful API,通过调用Restful API,取出Restful API的返回值中部分key的值.1)Rest中,每个对象都是1个URL;这里需要了解perl发送request,以及怎么处理response.http://www.redmine.org/projects/redmine/wiki/Rest_api_with_perlhttp://search.cpan.org/~ether/libwww-perl-6.15/lib/LWP/UserAgent.pm