`
hitgnu
  • 浏览: 95031 次
  • 性别: Icon_minigender_1
  • 来自: 苏州-->上海
社区版块
存档分类
最新评论

learn perl

阅读更多

#!/usr/bin/perl

print "Hello, World...\n";
printf "请问您的姓名?";
$name=<STDIN>;
chop($name);
printf "你好$name,欢迎光临网上学园!\n";

print"请输入一个字符串!\n";
$string=<STDIN>; #<STIDN>代表标准输入,会让使用者输入一字符串
chop($string); #将$string最后一个换行的字符\n删除掉
if($string!~/cgi/)
{#!~不相配运算符
 print("输入的字符串中没有cgi这个字符串!\n");#如果输入的字符串中没有cgi这个字符串的话,就会显示出这个信息
}
elsif ($string=~/cgi/)
{#=~相配运算符
 print("输入的字符串中有cgi这个字符串!\n");#如果输入的字符串中有cgi这个字符串的话,就会显示出这个信息
}

#读写文件,假设当前目录有一文件名为:test.txt



分享到:
评论

相关推荐

    Learn Perl in 21 days

    This is a super good perl tutorial. It will teach you perl by so many elementory examples and clear explanations. Worth treasuring.

    Learn Perl in a Weekend

    《周末学Perl》一书是为那些希望在短时间内迅速掌握Perl编程语言的读者设计的。Perl是一种高级、通用且解释性的脚本语言,以其灵活性和强大的文本处理能力著称,在系统管理、网络编程、Web开发等领域有着广泛的应用...

    learn_perl_by_example.pdf

    - **版本**:大多数Perl脚本都是为Perl 5.8或更高版本编写的。为了确保脚本的兼容性和可移植性,通常会在脚本的第一行指定Perl解释器的路径,例如 `#!/usr/bin/perl`。 ### 2. Perl基础知识 #### 2.1 变量 - **...

    minimal_perl_for_unix_and_linux_people.pdf

    hunch that many were hungering for an easier way to learn Perl. Since then, I’ve taught Minimal Perl at other professional conferences, at meetings of Perl Users Groups in the US and Canada, and to ...

    Apress.Beginning.Perl.3rd.Edition.Apr.2010

    This is a book for those of us who believed that we didn’t need to learn Perl, and now we know it is more ubiquitous than ever. Perl is extremely flexible and powerful, and it isn’t afraid of Web ...

    Perl 6 Deep Dive

    Learn Perl 6 effortlessly to solve everyday problems Filled with practical examples, this comprehensive guide explores all aspects of Perl 6. Leverage the power of Perl 6 concurrency to develop ...

    perl_爬虫脚本

    银行外汇牌价爬虫。结合中英两版网站信息,适合perl初学者学习模块和... Binding ounce version of the site information for beginners to learn perl module and hash arrays, etc. Txt file format code in them.

    Intermediate Perl.pdf

    Learn how Perl manages to keep track of pointers to data, and an introduction to anonymous data structures and autovivification. Chapter 6, Manipulating Complex Data Structures Create, access, and ...

    Modern.Perl.4th.Ed

    Learn how the language works, how to take advantage of the CPAN's immense trove of time-tested solutions, and how to write clear, concise, powerful code that runs everywhere. Specific coverage ...

    Think Perl 6: How to Think Like a Computer Scientist

    Think Perl 6: How to Think Like a Computer Scientist by Laurent Rosenfeld English | 8 May 2017 | ASIN: B0716P9W11 | 466 Pages | AZW3 | 1.02 MB Want to learn how to program and think like a computer ...

    learn_perl_oneliners:基于示例的命令行中Perl文本处理指南

    《learn_perl_oneliners》是一本专注于在命令行环境中使用Perl进行文本处理的实践指南。这本书通过丰富的实例,向读者展示了如何利用Perl的一行脚本(one-liners)高效地处理日常的文本任务。Perl作为一种强大的编程...

    Effective.Perl.Programming.Writing.Better.Programs.with.Perl.chm

    The book on Perl that experienced Perl programmers have been looking for, Effective ... Learn from Hall's answers to "real life" questions and problems he receives from newsgroups and his Perl seminars.

    Application_of_Perl_in_ASIC.pdf

    - 官方文档和教程:https://www.perl.org/learn.html - 书籍:《Perl语言入门(第5版)》(俗称“小骆驼书”) ##### 2.2 变量的定义与使用 Perl中的变量分为三种类型:标量(scalar)、数组(array)和哈希(hash)。...

    Practical Text Mining With Perl (zipped)

    This book, however, does make one demand: it assumes that you are willing to learn to write simple programs using Perl. This programming language is explicitly designed to work with text. In addition,...

    practice text mining with perl

    最后,可能还会讨论如何将Perl与其他语言(如Python、R)集成,以利用各自的优势,例如Python的NLP库NLTK和Scikit-learn,或是R的tm和caret包。这种跨语言协作在复杂文本挖掘项目中非常常见。 总的来说,《实践Perl...

Global site tag (gtag.js) - Google Analytics