When I run a Perl script in centos6.6, the "Server Version unavailable ... line 545" issue appears,650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6E/56/wKiom1V5QQqgUYmmAAE3u4RM610360.jpg "title=" Perl-sdk-545.png "alt="
1. Use anti-quotation marks to call an external program and return the output of the program, such as $cwd = ' pwd ';2. The difference between the variable types in Perl is mainly singular and plural; Singular variables are called scalar $scalar,
Maintenance function of 1.Unix systemAs we said earlier, Perl can be used as an alternative to traditional UNIX system maintenance tools, and in this context it can operate on text files, especially configuration files (which also remember how to
General output:
Print "$ A \ t $ B \ n ";
Align to the right:
Printf "% 20 s", "1234567890 \ n ";Printf "% 20 s" x @ lines, @ lines;
Align to left:
Printf "%-20 s", "1234567890 \ n ";Printf "%-20 s" x @ lines, @ lines;
Of course,
the conversion between Perl Chinese/Unicode/utf8/gb2312 encoding is a headache. I have summarized the following conversion methods for your reference.
# Author: jiangyujie Use utf8; Use encode; Use URI: escape; $/= "/N"; # utf8 encoding
Due to business needs, to query the customer's IP address and filter out customers in some regions, I began to think of using the IP database. It was a little difficult for me to read pure databases, however, my current time requirements are quite
. Any single-character wildcard (except \ n)* Matches the previous content zero or multiple times.+ Match the preceding content once or multiple times.? Match the previous content zero or once.Non-Greedy symbols.() Mode group\ 1 reverse (repeated)
Assume that I have a sub-process, which is defined as follows:
Sub test_sub {Print "test ";}
I have another variable:
$ Test = "test_sub ";
The value of $ test is the name of the face process. Since I know the sub-process name through $ test,
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
#
Find the input file list and return an array
Sub
Arr_argv_file {
My
@ Arr_fname
=
@_
;
My
@ Arr_file_list
;
Fcntl filehandle, function, scalar
Implements the fcntl (2) function. You'll probably have to say
Use Fcntl;
First to get the correct constant definitions. Argument processing and value returned work just likeIOCTLBelow. For example:
1. perldoc perllocal 2. We recommend pminst commands in pmtools.
Http://search.cpan.org/src/MLFISHER/pmtools-1.01/pminst 3. Prepare the following specimens
#! /Usr/bin/perluse strict; Use extutils: installed; my $ inst = extutils: installed-> New (
The first metacharacter is a dot (.). In regular expressions, dots are used to match any single character except line breaks. The simplest wildcard character is + metacharacters. + Match the preceding and subsequent characters at least once or at
Perl file handling: open, read, write and close files #======================== opening files
Solution 1:
Opening a file in Perl
open FILE, "filename.txt" or die $!; # read
open FILEHANDLE, MODE, EXPR
The available modes are the following:
1. Unless control structure
Execute when the condition is false, opposite to if
Else can be attached.
2. Until control structure
If the condition is false, it is executed until the condition is true;
3. Conditional Modifiers
The effect is
Use Perl to operate some basic functions of the Registry
Copyright Disclaimer: During reprinting, please use hyperlinks to indicate the original source and author information of the article and this
Processing of scalar or constantI. Objective and result storage:The target content of the default operation is in the default variable $ _, and the operation result is stored in $ _. If the operation succeeds $1, $2, $3, $ @ the variable also saves
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-and.
SyntaxThere are only two ways to create a 'quot.
Create reference
Create Rule 1 If you add a '/' sign before a variable, you will get the 'quota' of the variable '.
$ Aref = // @ array; # $ aref saves the 'quot' pointing to @ array'$ Href =/% hash; #
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.