"High watermark" algorithm: After the flood, the last wave subsided, the high waterline will indicate the highest water level seen.Here's a look at the "high watermark" algorithm used in Perl.
#! /usr/bin/perl;
Use UTF8;
Sub Max {my
Even if the strict and warnings options are turned on, the following code does not have errors and warnings.
Copy Code code as follows:
#!/usr/bin/perl
Use strict;
Use warnings;
Sub Test {
$a = 1;
$b = 2;
Print $a, "\ n";
Print $b, "\
$ can also match \ n
See Introduction to Perl Language, page 132, note 6
Can 1/^.*$/match "\ n"? Yes! Because the $ can match not only the end of the line, but also \ nCan 2/^.*$/match "b\n"? Can be!. Can b match. \ n Match $Can 3/^.*$/match "\NB"?
Perl-style variable substitution has better readability, and common JavaScript programming with a lot of + number, dazzling. The good news is that we can use regular expressions to help implement a programming-style transformation.
The following
Using two different functions, checkmd5sum.pl is faster than checkmd5sum_find.pl in terms of execution efficiency.
1.checkmd5sum.pl #!/usr/bin/perl # # File:checkmd5sum.pl # Author:amxku.net # date:2008-12-...The two use different functions, and
Perl read files in two common ways to reprint the whole read-in, line-wise processing
Open (FILE, "@linelist =;
foreach $eachline (@linelist) {
Print $eachline;
}
Close FILE;
Read-by-line, edge-read edge processing
Open (FILE, "while ()
Using Perl to dispatch SQL scripts, in the process of opening a number of processes, I found that Perl write log file order disorder, do not want to engage in multi-threading programming so troublesome, my processing method, the corresponding file
1.@_ is an array of parameters that are placed when a function is passed, and you can take arguments from it,
such as my ($para 1, $para 2 ...) =@_, when a function call is filled with several parameters, it is possible to take several parameters
resource Pack Download Https://pan.baidu.com/s/1U3myYp4GSmDUfZocMWI9FA password: Xdac
Resources that are provided with the resource bundle1. Upload mysql-client-5.5.55-1.linux2.6.x86_64.rpm, mysql-server-5.5.55-1.linux2.6.x86_64. RPM to Linux 2.
Test file when found that the output of Chinese is garbled, so learned a bit of Perl encode principle. Now do a summary:The basic knowledge of Perl: In Perl, there are only two forms of strings. One is octets, a 8-bit sequence, which is the byte
Note:Read the output of the "netstat-p tcp" command, extract the data in the foreign address section, and count the multiple connections of the same IP address.
Advantages:Compared with the output of the netstat command, you can more intuitively
Sort Function Sort list Sort Block List Sort subname list The usage of sort is as follows. It sorts the list and returns the sorted list. If the subname or block is ignored, sort is performed in the standard string comparison order (for example,
1. ChildProgram(In common ?), It starts with "&" in a call to distinguish it from "$" and @2. the scalar in the subroutine block is global without any modification. This subroutine is called multiple times in a file and can be modified multiple
1. A given expression has different meanings in different contexts2. In the scalar context, Nums returns the number of its elements. In the list context, its elements are returned.3. Print @ Nums; each element is not separated by spaces unless print
There are three methods to use shell commands in Perl:
System Functions
''
QX {}
First, the system function format is as follows:
System ("command ");
If the command runs normally, 0 is returned; otherwise, a non-zero value is
How to upgrade the default Perl version in Linux
16:42:00 | category:Linux | font size subscription
We do not recommend RM first.First download tar.gz... and then manually install .. default to the/usr/local/directory ..Then modify the symbolic link
Author: belltoy | statement: reprinted. The original address and author information and copyright statement must be indicated in hyperlink form during reprinting.
Web: http://www.belltoy.net/send-mail-with-perl.html
It's boring to sign in emails
Generally, Web sites include many services and applications. We cannot know whether the system is running normally in real time, especially when the server goes down or the application goes down at night, will affect the business andDuring user
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