1, according to the Nginx access log, according to the matching rules to detect the source domain name, according to the source domain name in a certain amount of time to determine the number of blocked objects
Put the following script into the
Perl is a practical summary and reporting language that is popular with developers around the world, and although it was born and developed on Unix, it has a niche in the area of Windows programming.
Under the leadership of companies such as
In this article we learned how to sort strings or arrays of numbers in Perl.
Perl has a built-in function called sort. There is no doubt that you can sort an array. The simplest form is to pass an array that returns an array of sorted elements.
An introduction to regular expressions in Perl
First, Introduction
Two, matching operator
Iii. special characters in the pattern
1, character +
2, characters [] and [^]
3, character * and?
4, escape character
5. Match any letter or number
6, Anchor
A summary of the use of Kazakhstan in Perl
To assign values to a hashing value pair with a fat arrow
%some_hash = (' jim ' => ', ' Tom ' => ', ' Jerry ' => ' 21 ');
Convert Hash to List
%any_hash = (K1, ' v1 ', K2, ' v2 ', K3, ' v3 ', K4, ' V4 ')
Perl has long been a popular text-processing tool for its inherent support for regular expressions. In this introductory article, we'll show you how to use regular expressions in your own programs to achieve more powerful text search and
#!/usr/bin/perl-w Sub npoint{My $CodeStr = $_[0]; Print $CodeStr. $/; my $CodeLen = 32; My $CodeSpace = $CodeLen-length ($CODESTR); if ($CodeSpace >= 1) {$CodeStr. = CHR) x $CodeSpace; } My $NewCode = 1; My @
Summarize: Q (), QQ (), QW (), QX (), respectively, are single quotes, double quotes, create string lists, and capture command output. 9th hours other functions and operators
One thing can be done in a variety of ways. The main contents of
1. Using regular expressions to modify text
1. Using regular expressions to modify textThe function of regular expressions is not only the query, but also the text can be modified, such as replacing$var=~m/regex/i
Recently there is a need for text analysis, because the analysis system uses Perl, and Perl under the excellent Chinese text analysis package is less, so call R processing text data.Why not PythonAlthough Python has complete support for NLP open
Chapter Two: Code deployment 00.the curly braces and parentheses are represented in the K&r style. ThatMy @name = (' Damian ',' Matthew ');For my $name (@names) {Formy $word (anagrams_of (LC $name)) {print "$wor \ n";}} 00 Ii.the control keyword and
Written in the first chapter:--------------------------------------------------------------------------------------This series is the learning excerpt from the Perl best practices!Interested friends can use the mailbox and I communicate! (You are
$ Total = 0;$ COUNT = 0;Eval {$ average = $ total/$ count; print "xxx/N ";};If ($ @){Print "wrong/N ";}Else{Print "right/N ";} The semicolon at the end of the eval block is required, because Eval is actually a function, unlike the if or while
Common Perl Functions
Command: PrintSyntax: Print filehandle listNote: This filehandle can be seen as a bridge between I (input) and O (output). You can use filehandle to read and write data. stdin indicates the connection from which data is input,
In Perl development, it is very likely that some files in different formats, such as XML, PDF, CSV, and RSS files, are different from some binary data formats. Perl applications need to operate on these files to read and write them.
In this case,
1. Length of the array:
If you assign an array variable to a scalar variable, the length of the array is assigned to the scalar variable:
$ A = @ array; # The length of the array @ array is stored in the scalar variable $ A, that is, the number of
I have used awk, Python, and Perl to switch logs. I still feel that Perl is a master of log cutting. It has high execution efficiency and powerful functions. Below is a small example:Open (file, "/data/EBI/META/log ");Open (Conf,
= Head1 name
The name of your program or module.
= Head1 synopsis
A one-line description of what your program or module does (purportedly ).
= Head1 description
The bulk of your documentation. (bulk is good in this context .)
= Head1
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.