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
Definition of a function
A subroutine is a piece of detached code that allows you to reduce duplicate code and the program is readable. In Perl, subroutines can appear anywhere in the program. But usually at the beginning or end of the program.
The <> operators in Perl can be used for the following purposes:
1 if the middle of the angle bracket is a file handle, the angle bracket operator allows you to read the file handle, such as .2 If the middle of the angle bracket is a search pattern,
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
#!/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 @
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
In the Perl language, there are only two forms of strings:(1) Byte stream string: resolves to a single byte string, regardless of the content or encoding of the string.(2) Character stream string: According to UTF8 encoding scheme, the byte stream
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
1.> clear file data and overwrite;> append at the end of the file2. It is recommended that you close a file handle immediately, regardless of whether the program ends immediately.3. $! Indicates some readable information generated by the system,
Notice a great post on Reddit, the author listed some useful modules in it. I am excited for that Perl community always appears to be full of vitality and innovation that surprise us.
Below content is referring to
#! /Usr/bin/perl-W
Use strict;
Use lwp;Use http: Request: Common QW (Post get );Use http: cookies;Use lwp: useragent;Use lwp: simple;Use URI: URL;
My $ UA = lwp: useragent-> new;$ UA-> agent ("Mozilla 1.503 Windows XP ");$ UA-> cookie_jar (http:
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
In addition to alternative list implementations, the Library also offers other tools such asBisectModule with functions for manipulating sorted lists:
>>> Import bisect >>> scores = [(100, 'perl '), (200, 'tcl'), (400, 'lua'), (500, 'python')]>
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
1. What is Perl Hash?
A hash is a data structure. Similar to an array, a hash can store a value or retrieve the value from it. However, unlike an array, its index is not a number but a name. That is to say, the index (here we call it key) is not a
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