Perl is still less than that. Watching video is quite handy when getting started, just like a movie. I basically superor the teacher every episode I have read. I hope everyone will take a look at it.
Remember, learn to write more, can only see
Built-in variable $_:Let's take a look at an example:
Copy Code code as follows:
#!/usr/bin/perl-w
@array = QW (a b c d);
foreach (@array) {
Print $_, "";
}
The role of an example is to define an array and print out the
These days I looked at Perl's event programming framework Anyevent, focusing on a few articles:
http://search.cpan.org/~mlehmann/AnyEvent-7.05/lib/AnyEvent.pm
Http://search.cpan.org/~mlehmann/AnyEvent-7.05/lib/AnyEvent/Intro.pod
Perl use vs. require usage
Contrast (i) Description:Both of these functions are a means of loading and referencing Perl's modules, or subroutines,
The difference is that Perl use is found in the current default, and once the module is not in the
On the networking side, the most basic is BSD socket programming, but often when Perl is getting started in this area, the biggest headache is undoubtedly how to start, how to step by step. The best remedy is example, a complete code that can be run
1 All numbers in Perl have the same internal format, only double-precision floating-point numbers (there is no integer value inside perl).
2 Perl allows the use of underscores to delimit longer integers, such as 612980400283768 and 612_980_400_283_76
First, Perl installation:1. Download and unzip the software: Tar zxvf perl-5.24.0.tar.gz2, run./configure.gnu-help view Help, run./configure.gnu-des-dprefix=/usr/local/perl-dusethreads-uversiononly Set source code3. Compiling and installing
The array element in Perl starts with a reference ordinal of 0, the first element of the @array is $array[0], increments sequentially, and the last element is $array[-1] or $ #array. If you want to delete an existing element in an array, you can do
Demand:The host has hundreds of backup files to Rsync to the remote host, we will cut the large file for dozens of small files for multi-threaded transmission.Here is a demo using 14 1G files:[[Email protected] test]# pwd/root/test[[email protected]
In the process of building Elasticsearch database, the first use of its recommended Logstash tools to import data, but it is very uncomfortable to use, so you want to use Perl good regular expression to filter the data classification, and then
When the Perl script begins to execute, it opens by default3File handle: Stdout,stdin,stderrstdout (Standard OUTPU) is the default output file handle. The data sent to this file handle is displayed on the user-specified output device, typically a
1) Remember just beginning to write Perl, for a function, always take the current data types can be used to solve the problem, do not want to think there is no better, can be used to solve the problem is good, which led to the late, to add
Input and Output1, read the standard input (the form of keyboard input is called standard input)$line = ; #读取下一行Chomp ($line); #截掉最后的换行符Chomp ($line = ); #习惯用法, the effect is as aboveIf you read the end of the file (end-of-file), the line input
1. Numeric Operators: + (Plus),-(minus), * (multiplication),/(Division), ** (multiplication party/power), % (remainder );These operators mix integers, floating-point numbers, and real numbers. The calculation results are in the correct numeric
All numbers have the same format internally in prel. In fact the Perl use double-precision floating-point value to store numbers.
Creating charaters by code point: CHR (), and ord () metheds.
E.g.
$alef = chr(0x05df) ;$code_point = ord('d') ;
In
The most common method for parsing XML in Perl is to use XML: Dom and XML: simple. XML: The Dom is too large and the parsing result is a DOM tree, which is inconvenient to operate. For small and non-complex XML files, XML: Dom is a cool tool. Now it'
From: http://bbs.chinaunix.net/thread-1191868-1-1.html #
The best way to make your Perl code look more like Perl code than C or basic code is to understand the built-in variables of Perl. Perl can use these built-in variables to control
Original Name: Brian's Guide to solving any Perl Problem
Moderate: Brian's omnipotent guide to Perl issuesPrepared by: Brian D FoyOriginal article: http://www252.pair.com/comdog/brian's_guide.podOutput table:Translation: KlausAudit: QiangExit:
I. Several Questions1. Find a string that does not contain "ABC"Test Case 1 ==> ABC (non-conforming)Test Case 2 ==> xabc (not met)Test Case 3 ==> abcy (not met)Test Case 4 ==> xabcy (not met)Test Case 5 ==> XXXX xabcy (not met)Test Case 6 ==> XXX
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.