, commaIs the function of a connection: $a +=1, $b = $a; ==> $a +=1; $b = $a;No eggs.Eight, conditional operatorsThree operands: evaluates the conditional expression first, and executes the question mark (? The following operation, which executes a colon when false (:) After the operation.$result = $var = = 0? 14:7 #一般只用于简单的条件 too complex is not as good as if statement looks intuitiveIx. Precedence of operators (precedence)Self-increment self-reduction highest, single operand higher than multi-o
Method 1:
Maven is used to build an application in the past two days, there are more than 700 pom. XML file, even more depressing is in many pom. the URL of the resource library is specified separately in the XML file. I need to uniformly specify the URLs of these resource libraries to the local central nexus library. it is not practical to manually change the file configurations one by one, So Google will find a good way to replace the file content in batches. The command structure is as
Perl reads multiple lines of text at a time. perl reads multiple lines of text at a time.
When processing text, we often encounter the following situation: we need to compare the two lines of text and then output them selectively. By default, only one row can be read at a time in the while (
There is a text like this:
A 1 2 3 4A 5 6 7 8A 6 7 8 9A 7 8 9 11A 7 8 9 12A 13 12 14 15A 18 14 16 17A 2 3 4 65
The r
Preface
Sometimes there are these requirements:
1. count the number of rows of a file
2. Calculate the number of valid lines of a source code. Exclude empty and comment rows
3. Unify the quantity and number of files in a directory
Many languages can achieve these needs, but using Perl should be a good choice.
Number of lines reading files
It's easy to use Perl to read the total number of lines in a file (
1.PERL4 Kinds of variablesScalar: $ pure variable, scalarArray: @Hash:%File: Uppercase2. Variable composition1. Naming rules case sensitive, alphanumeric underline ...2. No keywords, $+ other, but can not conflict with built-in variables.3. The name length is infinite.3. In pure variables: integer, float, character, string,Integer variable1. You can use _ to divide character numbers2.012 is octal 103.0X1F is 16 binaryFloating-point variable1.11.42.-0.33..3can represent a 15-bit valid number, tru
1. Module source: Pack and download from CPAN together with the Perl release version
2. Read the module documentation: perldoc CGI
3. Installation Module
Makemaker mode:
Specify the installation directory:
Module: Build mode:
CPAN method:
4. File: basename Module
5. Select only some functions of the module.
Import the reference list.
10. Do not introduce any function
Use the full name:
11. File: spec Module
12. cgi.
First, we recommend a good module download site: http://search.cpan.org
Today in Windows XP installed on the ActivePerl-5.12.2.1202-MSWin32-x86-293621.msi, open the project under eclipse, there are a lot of places to prompt the error is because the local no installation of related modules caused, then download the template from the above website for installation.
Many errors encountered during the installation process are recorded here, hoping to help
Practical Extraction and Report Language
Perl was originally designed by Larry Wall in December 18, 1987. Perl uses the features of C, sed, awk, shell scripting, and many other programming languages.
Perl is generally called the Practical Extraction and report language, although it is sometimes called the pathologicallyeclectic rubbish Lister ). It is the term,
develop a unified indentation specification is a truly operable system.Introduction to several open-source code beautification tools
Tool Name
Applicable Language
Introduction
Installation/Use
Indent
C
Indent is synonymous with code beautification tools
Indent is a standard tool attached to GCC,Indent [Options] [input-files]Indent [Options] [Single-Input-file] [-O output-file]
Perltidy
Which platforms have Perl on? Where are we going to find them?
The standard release of Perl (maintained by the Perl Development Group) is distributed only in the original code form. You can obtain it at http://www.perl.com/cpan/src/latest.tar.gz. The format of this file is the POSIX tar filing cabinet, which is then compressed in gzip format. This source code ca
Author: hoowa Source: AKA magazine
"How did Larry Wall invent a messy programming language-and then changed the Web landscape? "
Larrywall smiled and recalled the message that David Filo, the co-founder of Yahoo, sent to him a few years ago, shortly before Yahoo was publicly available. file wrote: "Without Perl, the general programming language invented by wall, Yahoo cannot begin. so, Larry, are you willing to buy some cheap, Yahoo's original stock
mechanism to develop a unified indentation specification is a truly operable system.
Introduction to several open-source code beautification tools
Tool Name applicable language introduction installation/Use
Cindent is synonymous with code beautification tools. indent is a standard tool attached to GCC,
Indent [Options] [input-files]
Indent [Options] [Single-Input-file] [-O output-file]
Perlperltidy is also written in Perl. After downloading:
Enable Perl before compiling Vim;
Use the Perl interface ** Perl-using **: Perl **: Pe *: PE [RL]{cmd}Run the Perl Command{cmd}. The current package is "Main ". : PE [RL] {endpattern}{script}{endpattern}Execute the Perl script{s
What is Perl?
Perl is a high-level programming language, written by Larry Wall and many others, and incorporates the characteristics of many languages. It is mainly by the ubiquitous C language, followed by the SED, Awk,unix shell and at least a dozen other tools and languages evolved. Perl for process, files, and text has a very strong processing and transforma
About the origins and characteristics of Perl and Python
Perl is the abbreviation of practical extraction and report Language, created by Larry Wall in 1987, originally designed to facilitate the processing of reports on UNIX, and has become a fully functional programming language after a long period of development, The current latest version for Perl5.14.1,perl
I. Data Types(Data type):
Perl has four data types: Scalar (variable), Scalar Array (Array), Hash Array (Hash), and References (pointer ), it seems to be rare, but it is more than enough to use it. Especially when writing Perl programs, you do not need to declare variables in advance. This is very convenient for those who are new to programming languages. However, in order to facilitate program debugging a
one. DataType (data type ):
Perl's data types are roughly four: Scalar (variables), Scalar Array (array), hash array (hash), References (pointer), but they seem to be small but more than sufficient. In particular, you can write a Perl program without the prior declaration of variables, this is very convenient to learn the language of the program, but in order to later debugging and maintenance convenience, I suggest you or form the habit of declaring
The concept of the Perl method in the Perl language do you know, here's a quick introduction to Perl's perl approach as a Perl subroutine, or a commonly called member function.
Perl method
A brief introduction of Perl method
Reference
Common Perl Command Line options
Common unix Commands: perl implements sed awk tr nl
Perl, sed, awk, tr, grep, nl, and other common commandsSed
Task
Sed
Perl
Replace12WithTwelve
sed 's/12/twelve/g'
perl -pe 's/12/twelve/g'
Re
Http://www.mdbbs.org/thread-28471-1-1.html This is a reference method when I learn Perl, I feel very good, share with you:
Each person has different learning methods. The following are some examples for your reference.
If Perl is the first programming language you have learned, we recommend that you first read some programming basics, process control, logic, and design knowledge. _ Do you have any good C
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.