DescriptionWhen you configure some services, you need to install the Perl module. There are two ways to install the Perl module: Manual Installation and automatic installation.The perl–mcpan–e ' Install XXX ' automatically installs the Perl module,
Hello WorldA simple Hello World example:
Copy Code code as follows:
#!/usr/bin/env Perl
Use strict;
Use warnings;
Use Cgi::fast;
while (my $q = new Cgi::fast)
{
Print $q->header ("Text/plain");
print "Hello World";
}
Special variable of regular expression
1, $n: The nth substring containing the last pattern match2, $&: Previous successful pattern matching string3, $ ': previous match successful substring before4, $ ': After the substring of the previous match
Introduction to the Perl language instructions for a scalar scalar constant numeric string number and string conversion scalar variable Print output result comparison operator get user input undef value scalar context two list array list arrays note
Perl is an abbreviation for practical Extraction and report Language, which can be translated as a "utility statement extraction language".Perl Syntax Basics:(1) Perl programs consist of statements and statements(2) Perl program execution from top
Thread: A scan that uses multithreading to handle large amounts of data and encounters a possible deadlock in read-write files. The life cycle of a Perl thread1. Use the Create () method of the Threads package: Use threads; Sub Say_hello {
"Reprint" Source: http://www.cnblogs.com/visayafan/
1 Arrays and references
2 Differences of the statements
3 Differences in Access
4 Adding row elements
5 Adding column elements
6 Accessing and printing
6.1
A) Sort function usageSort LISTSort BLOCK LISTSort SubName LISTThe use of sort is in the form of 3. It sorts the list and returns the sorted lists. If the subname or Block,sort are ignored in the order of standard string comparisons (for example,
13th Perl Object-oriented programmingby FlamephoenixI. Introduction of the ModuleSecond, the class in PerlThird, create the classFour, the constructor function
Instance variable
V. MethodsVi. output of the methodVii. Invocation of
The hash data structure in Perl.A hash is a data structure that consists of a pair of keys-values pairs.These keys and values are arbitrary scalars, but the keys are always converted to strings and must be unique strings.Access to the hash element, $
I. Introduction of the ModuleModule is the Perl package. The Perl object is based on a reference to the data item in the package.When you use object-oriented programming in other languages, you declare a class and then create an object (instance) of
1. parse XML
Two packages are used:
# Use moduleUse XML: simple;Use Data: dumper;
Process:
# Create object$ Xml = New XML: simple;
# Parsing
$ DATA = $ XML-> xmlin (XML file name );
# Value
My $ value = $ data->
This is notes from reading the "Object Oriented Perl programming ".
Elements of the @ _ array are special in that they are not copies of the actual arguments of the function call. rather they are aliases for those arguments. that means that if
A nested loop structure is often used in programming. Sometimes, a method is required to interrupt it. Perl provides the following four loop modifiers: continue, next, last, redo;
1. Continue statement block:
The incremental list of the for loop is
A brief description of http://www.perldoc.com/perl5.6/pod/perlmodlib.html for some common modules
Use modules in Perl:Module: http://www.cpan.org/modules/01modules.index.htmlInstallation module:1. Perl makefile. pl2. Make3. Make Test4. Make
Die Function
18.4 handle errors
In many cases, system calls may fail. For example, you can try to open a non-existing file, delete a directory that still contains the file, or
Try to read files without read permission. In the previous example, we
1. Simple Variables
==============
1. Integer$ X = 123456;Perl stores integer data in floating-point registers. In fact, integer variables are treated as floating-point numbers in Perl, but they are only a special column of floating-point data.The
Compared with Perl, Perl is still relatively small. It is quite convenient to watch videos when getting started, just like watching movies. I have read almost every episode of Superor. I hope you can take a closer look.
Note: You need to write more
How to show Chinese character by using Perl ?, Characterperl
You need to usemodule:Unicode: Map
Where to get it?
-Http://search.cpan.org /~ Mschwartz/Unicode-Map-0.112/Map. pm
Download Unicode-Map-0.112.tar.gz
How to install it?
-Unzip the file
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.