hsy75的个人空间 https://blog.eetop.cn/vivilife [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

[O][perl basic 001]How to install perl:

已有 1351 次阅读| 2012-7-2 12:22 |个人分类:practic_linux



1 what is perl?

Perl是一种高階、通用、直譯式動態的程式语言。最初设计者拉里·沃尔Larry Wall)為了讓在UNIX上進行報表處理的工作變得更方便,決定開發一個通用的腳本語言,而在1987年12月18日發表。Perl借取了Csedawkshell脚本以及很多其他程式語言的特性。其中最重要的特性是他内部集成了正则表达式的功能,以及巨大的第三方代码库CPAN。目前拉里·沃尔已經開發Perl 6,來作為Perl的後繼;不過,Perl 6語言的語法有很多轉變,所以Perl 6被視為Perl家族中的另一個語言。


2 Perl语言的中心思想
There's More Than One Way To Do It.(不只一种方法來做这件事。)


缺点

也正是因为Perl的灵活性和“过度”的冗余语法,也因此获得了write-only的“美誉”,因为Perl程序可以写得很随意(例如,变量不经 声明就可以直接使用,以及少写一些字母就会得到意想不到的结果),许多Perl程序的代码令人难以阅读,实现相同功能的程序代码长度可以相差十倍百倍,这 就令程序的维护者(甚至是编写者)难以维护。

建议的解决方法是

在程序里使用use strict;以及use warning;,并统一代码风格,使用库,而不是自己使用「硬编码」。

Perl同样可以将代码书写得像PythonRuby等语言一样优雅。


1 Practice Install perl:
franklin@franklin-LifeBook-S-Series:~$ curl -L http://xrl.us/installperlnix | bash
The program 'curl' is currently not installed.  You can install it by typing:
sudo apt-get install curl
franklin@franklin-LifeBook-S-Series:~$ sudo apt-get install curl
[sudo] password for franklin:
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following NEW packages will be installed:
  curl
0 upgraded, 1 newly installed, 0 to remove and 390 not upgraded.
Need to get 229kB of archives.
After this operation, 344kB of additional disk space will be used.
Get:1 http://mo.archive.ubuntu.com/ubuntu/ maverick-updates/main curl i386 7.21.0-1ubuntu1.3 [229kB]
Fetched 229kB in 3s (62.5kB/s)
Selecting previously deselected package curl.
(Reading database ... 122486 files and directories currently installed.)
Unpacking curl (from .../curl_7.21.0-1ubuntu1.3_i386.deb) ...
Processing triggers for man-db ...
Setting up curl (7.21.0-1ubuntu1.3) ...






Appendix - A:

Perl
多重编程范式
发行时间
1987年
設計者
拉里·沃尔
最新发行时间 5.14.2 (2011年9月26日)
Dynamic
啟發語言
AWKBASICBASIC-PLUSC語言C++LISPPascalsedUnix shell
影響語言
PythonPHPRubyECMAScript
跨平台
GNU通用公共许可证Artistic License
http://www.perl.org

Appendex B: Larry Wall

Howdy, world! This website is under construction.

(Did you ever see a website that wasn't under construction?)

Yes, I'm afraid chartreuse is one of my favorite colors...

No, I'm not going to change it just because it's not your favorite...


more information for PERL:

1 www.perl.com

2 CPAN: www.cpan.org

3 perlbuzz.com




ref:
1 http://zh.wikipedia.org/wiki/Perl
2 http://www.wall.org/~larry/
3 http://www.perl.org/learn.html

点赞

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 2

    粉丝
  • 1

    好友
  • 2

    获赞
  • 14

    评论
  • 3241

    访问数
关闭

站长推荐 上一条 /2 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-4-17 04:05 , Processed in 0.029121 second(s), 14 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部