Perl: Basic Knowledge

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.