Using serial communication, use the following script at the standby to detect heartbeat signal from the host, once the number of not accepted more than the specified number, the standby machine think the host down machine, automatically set as the
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
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
In other forums, a lot of the installation of Perl modules, in fact, sometimes very easy to install failure.
Especially on Windows, such as tools such as cpan,ppm can be used. At the command line
Enter CPAN, eject cpan>, and then enter install
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
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]
I've written a similar blog before: http://blog.csdn.net/three_man/article/details/34084361Take it out today and take a good look at it:1. Construct an array containing duplicate elementsmy@arr1 = (110);my@arr2 = (515);# join multi arraymy@arr =
Perl as a text processing language, will naturally have his recursive writing, the younger brother here to share two examples, I hope to be useful to everyone!Factorial (most classic recursion)#!/usr/bin/perl-s my $Result = 1;sub getresult{my $num =
Matches: m/;/ (can also be shortened to/;/, omit m)Replacement: s/;/;/Conversion: tr/;/;/These three forms are generally used in conjunction with =~ or!~ (where "=~" means matching, read as does in the entire statement, "!~" for mismatches, read as
Komodo IDE + ActivePerlThe most common, entry-level, fool-mounted configuration.But now I use sublime-based, cross-platform are very useful, and plug-in really many, their own development convenience.SublimeCreate a newTools->build system->new Build
Perl reads and writes XML: The main is to write always forget how to engage ... first-read XML 1) XML instance " linux US mac US " windows US 2) Code Use file::basename; Use xml::simple; Use Data::D umper; My $xmlfile = DirName ($). "\\
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
1. Set up the Perl runtime environment. ActivePerl can be used in windows. After installation, check whether the path contains the perl directory, or if the environment is successfully set up by hitting Perl-H in the console. 2. Compile a Perl
Requirement: the Perl script controls the experiment process. Because different applications need to set different experiment environments, You need to reset the environment variables according to the input. Environment Variable initialization
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
Four basic data types in Perl (as far as I know): Scalar, array, list, and hash.
Scalar should be the atomic Data Structure in Perl, which cannot be further decomposed by programmers, such as int and double in C language. For scalar, I have the
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
Http://www.mdbbs.org/thread-28471-1-1.html This is a reference method when I learn Perl, I feel very good, share with you:
Each person has different learning methods. The following are some examples for your reference.
If Perl is the first
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