We sometimes execute a script because some of the programs in the script are suspended and timed out, which affects our judgment of the next step. Random we have to set the timeout for functions and processes so that he does not respond after a
Because Perl's compile-and-install is a hassle, it's a lot of people. I specifically made the latest Perl 6 a direct installation of the RPM package on CentOS 6. Just install the following three things.
The code is as follows
Copy
Perl considers truth values to be self-evident (self-evident), which means that the truth of any thing can be computed. Perl defines truth values in a practical way, that is, the truth of an entity depends on the type of the entity. Perl is always
I. Definition
A subroutine is a separate piece of code that performs a special task, which makes it easy to reduce duplicate code and make the program readable. In Perl, subroutines can appear anywhere in the program. The method is defined as:
Sub
Common processing signals under Unix
Copy Code code as follows:
No Name Default Action Description
1 sighup Terminate process terminal line Hangup
2 SIGINT Terminate process interrupt Program
3 Sigquit Create core Image quit program
You provide a number of Linux open proxy methods, generally used in Python and other languages, some servers may not be installed, but Perl can be said to be the standard Linux language, to give everyone a Perl language socket agent, the code is
Why use references?
In Perl4, the Value field in a hash table can only be scalar, not a list, which is inconvenient for some situations, such as the following data:Chicago, USAFrankfurt, GermanyBerlin, GermanyWashington, USAHelsinki, FinlandNew
1) The default Inc is as follows:
Copy Code code as follows:
@INC:
C:/perl/site/lib
C:/perl/lib
2 Set up environment variable PERL5LIB to add to Inc, for example:Set Perl5lib=c:\perllibs
After setting the Perl5lib as below,
Let's take a look at our usage.
Require 5.006When the version number is less than 5.006, the failure is returned, causing the module to fail to load.So its role is to ensure that the module invokes the Perl version of the environment.
Our, like my,
To include double quotes or backslashes in the string, add a backslash before it, and the backslash can also cancel the variable substitution
Single quotes another feature that can span multiple lines, such as:$text = ' This is twoLines of text';is
In some cases, there is an already ordered array, if you want to get a number in the order of the array, using the traversal method will be slower, as follows is a quick get position of the function, will return: In this array, how many values are
Use spreadsheet in CPAN::P arseexcel module to read the contents of the Excel file, when encountering Chinese garbled problem, use spreadsheet::P arseexcel::fmtunicode module recoding, When assigning Chinese to a variable, the Encode module is
Source:Http://www.cnblogs.com/itech/archive/2013/02/20/2919204.htmlHttp://stackoverflow.com/questions/5703705/print-current-directory-using-perl?rq=11)The following get the script ' s directory, which is not the same as the current directory. It ' s
1. $ position = index (string, substring, skipchars );
This function returns the position of the substring in the string. If the substring does not exist,-1 is returned. The skipchars parameter is an optional parameter, indicating the number of
Use of exit functions in Perl
O exit exprO exit
This function calculates the expr value as an integer and uses this value as the finalProgramError statusExit. If expr is omitted, the function exits as 0 (meaning "no error ").
At the same time,
Command: Print
Syntax: Print filehandle list
Note: 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, for example, from
In order to select a suitable scripting language for learning, I checked a lot about Perl, Python, Ruby, and JavaScript today, but I found that people in various camps are touching their favorite languages, however, it is not controversial that
Gethostbyaddr (Perl)
Gethostbyaddr ADDR, addrtype
This function converts an address to a name (or modifies an address ). ADDR should be the binary network address of a packet, while addrtype should actually be af_inet (from the socket module ).
I. Introduction
The pattern refers to the character of a specific sequence in the string. The backslash contains:/DEF/That is, the pattern def. Its usage is as follows: Use the function split to divide a string into multiple words in a certain mode:
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