Work needs to start with Perl, download a window version (5.16): Download linkHttp://www.activestate.com/activeperl/downloadsOnce installed, write the first Perl program
Copy Code code as follows:
#!/usr/bin/perl
print "hello,world!\
According to personal experience, do not say the good and bad of both, just say the similarities and differences between the two.
1, variable name
There are three definitions of Perl variable names, beginning with $,%, and @, representing general
Read the document: After HTTP://SEARCH.CPAN.ORG/~GAAS/DIGEST-MD5-2.39/MD5.PM,
Very useful Chapter paragraph:
This is useful if calculating checksum for files:
Use DIGEST::MD5;
My $file = Shift | | "/ETC/PASSWD";
Open (FILE, $file)
#!/usr/bin/perl# Filename:BuildSocketTCP.pm## Copyright Axxeo GmbH# Licensed under the Apache License, Version 2.0 (the "License");# You are not a use of this file except in compliance with the License.# Obtain a copy of the License at##
1 #!/usr/bin/perl-w2 UseStrict;3 UseMail::Sender;4 5 my $count=1;6 while(1){7 my $sender= mail::sender->New ({8SMTP ='smtp.163.com',9 #Here's an example of 163 .Tenfrom = ='Write your 163 e-mail address here: [Email protected]', OneAuth =
On the Unix/linux system, open the command terminal, enter ' Rpm-q Perl ' to see if Perl is installed on the system----on its own CentOS7 system, with Perl software by default:Perl Perl-5.16. 3-286. el7.x86_64You can see that the system has PERL5
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
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
For some strings, the input must be in a specific format. sprintf can be used for convenient processing, and no additional processing is required.
The usage of sprintf in Perl is as follows:
Sprintf format, list
For example:
$ Result =
I. Causes of danger
1. WebProgramIt's easy to get started, and you can write it after simple training. The level of programs written is naturally uneven.
2. Many people do not have security awareness. You have no idea about the concept of "SQL
We often use a program in Linux to add parameters. Now let's take a look at the functions related to control parameters in Perl. getopt. in Linux, there are two types of parameters. one is -- help, and the other is-H. that is, the difference between-
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
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
Perl has been used by two teams in the Department recently, but few people have access to this strange language. Coincidentally, I revealed in the chat that I was a Perl enthusiast, so I was called to give my colleagues an introduction session. I am
Submitted a question on stackoverflow just now.
I intended to extract content from a web page which contains character Unicode characters represented in the form of "% xx ". as I used Perl module lwp to get web page, naturally handled These unicode
The Python Perl script cannot be directly executed after it is submitted by CVS.
The Python Perl script cannot be directly executed after it is submitted by CVS.
The reason is that the line feed in Windows is different from that in Linux.
1. First understand the/proc/STAT File Information
In Linux/Unix, CPU utilization is divided into user-state, system-state, and idle state, indicating the time when the CPU is in user-state, and the time when the system kernel is executed, and the
Perl contains some predefined file handles. Such as standard input stdin, standard output stdout, and standard error stderr. The standard error stderr is an additional output path. How can we understand this sentence? Let's look at an example.% Perl-
Use a subroutine to remove the spaces at the beginning and end of each line read from the file. The print Value of the sub function is no longer blank, but the returned value is printed with spaces. The Code is as follows:
While ()
{
& Trim ($
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