Perl:
Practical Extractionand Report Language, practical reports extraction language.
Borrowing the features of C, sed, awk, Shell, and many other programming languages is the Dream scripting language for Linux and UNIX. Used primarily for text processing, for small applications and scripts.
Perl solves problems in a variety of ways.
Perl is written in C language.
Cpan:comprehensiveperl Archive Network, Perl program Library.
Cgi:common Gatewayinterface, Universal Gateway Interface, CGI's main programming language is Perl.
Installation of Perl:
sudo apt-get install PERL5
There are two methods of writing Perl scripts in Linux:
1. First line: #!/usr/bin/perl
2. Change properties: Chmodu+x XXX.PLX
3. Implementation:./XXX.PLX
Or:
Perl XXX.PLX
The Perl statement is semicolon-terminated, and each line is a statement.
#####################################################
Options for Perl:
-C Lookup Syntax error
-i.bak set $^i to. Bak, which is the backup source file
-E lets the program run at the command line.
-M using modules
-N Loop function
-P loop, while printing $_.
-A open auto-detach mode
-F Specify delimiter
-L add line for each line of output
Options for Perldoc:
Perldoc Perldoc #查看perldoc用法
Perldoc Perl #查看perl的概述
Perldoc Perlfaq #常见问题
Perldoc func #查看所有perl的内置函数
-I ignores case
-R Iterative Lookup
Perldoc-f builtinfunction #查看内建函数的用法
Perldoc-l it-f builtinfunction
Perldoc-q Faq–keyword #常见问题的查询
Perldoc-l fr-q FAQ keyword
Perldoc-v perlvariable #查看perl的内置变量信息
Perldoc Module #查看模块帮助
Perldoc-m Module #查看模块的源代码
####################################################
Basic syntax for Perl:
Statements are terminated with commas.
Keywords in perl:
If/unless/else/elsif
While/until
Foreach/for
Eq/ne/ge/le/gt/lt
and/or/not/xor/x
Given/when
Cmp
Default
"AUTOLOAD", "BEGIN", "END", "CHECK", "CORE", "DESTROY", "Unitcheck", "INIT", "__data__", "__end__",
and scope-Related keywords:
Use
Import
Package
Local
My
Caller
Our
State
Perl: Basic Knowledge