- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
Introduction to Perl What is Perl? Practical Extraction and Report Language 实用摘录与报告语言 Pathlogical Eclectic Rubbish Lister 反常,折中的垃圾陈列器 What is Perl? Perl is a Portable Scripting Language No compiling is needed. Runs on Windows, UNIX and LINUX Fast and easy text processing capability Fast and easy file handling capability Written by Larry Wall “Perl is the language for getting your job done.” How to Access Perl Off the school network Located on the 100.10 machines at: /usr/local/bin/perl To install at home Has rpms for Linux Has binaries for Windows Latest Version is 5.8 To check if Perl is working and the version number % perl -v The Basic Hello World Program Program: #!/usr/local/bin/perl -w print “Hello World!\n”; Save this as “hello.pl” Give it executable permissions chmod ug+x hello.pl Run it as follows: ./hello.pl “Hello World” Observations “.pl” extension is optional but is commonly used The first line “#!/usr/local/bin/perl” tells UNIX where to find Perl “-w” switches on warning : not required but a really good idea How to use Perl Syntax A Web Server Example 要记住,过早的优化往往是错误的根源。如果您在 Perl 中写了一个原型,并用其他语言来重写是没有问题的。原型意味着能够方便地开发。 Perl 解释器 速度和 Benchmark Perl 的容错能力 Perl 的缺憾 速度 算法,内置函数 训练 面向对象 线程以及统一字符编码 Perl 的优势 某些方面的优势,例如: 正则表达式 隐含的函数声明 不严格的语法 象日用文档似的程序结构 通用的灵活,大大减少开发的时间 几乎没有任何 C 或 C++ 能做而 Perl 不能的事情 Syntax Literals Types of Variables Operators String Functions Loop Numerical Literals Numerical Literals 6 Integer 12.6 Floating Point 1e10 Scientific Notation 6.4E-33 Scientific Notation 4_348_348 Underscores instead of commas for long numbers String Literals String Literals “There is more than on way to do it!” Just dont create a file called -rf. “Beauty?\nWhats that?\n” “” “Real programmers can write assembly in any language.” Quotes from Larry Wall Types of Variables Types of variables: Scalar variables : $a, $b, $c Array variables : @array Hash variables : %hash File handles
文档评论(0)