In Perl, there are modules dedicated to processing list data, such as the List::util module, which is included in the standard library and provides a variety of efficient common list processing tools. Because of its use of C language to achieve,
First, the preface
Recently wrote a program to download the attachments from Gmail in bulk, using Mail::P op3client and MIME::P arser 2 Modules
Second, related documents
Cpan:Mail::P op3client ModuleMIME::P arser Moduleinstallation, uninstall and
By default, it is clear that the rows are distinguished by \ n, which we also call as line breaks.
When reading a sequence, when read by row, the line break is the standard.
The contents of the read STRAWBERRY1.GB file are as follows:
Locus JX118024
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,
Perl's syntax is relatively obscure, mainly because some of the built-in variables and functions are handled fairly finely, and the overly refined stuff is a bit laborious to understand. Relative to the Shell,perl in many ways more powerful and
Our usage in PerlRequire 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, are
Reference Link: http://stackoverflow.com/questions/841785/how-do-i-include-a-perl-module-thats-in-a-different-directory Http://stackoverflow.com/questions/185114/how-do-i-use-a-perl-module-in-a-directory-not-in-inc
In Fedora/rhel/centos, the
Original address: HTTP://BLOGREAD.CN/IT/ARTICLE/743?F=WB
Some monitoring scripts are written in Perl and are scheduled for execution in Crontab. Sometimes it is found that a script runs too long and runs multiple instances at the same time, so it
In text processing often encounter such a situation: there are a number of files need to modify the contents, but also want to keep the original file content. This time Perl provides a very convenient variable $^i, will need to save the backup file
Assigning values to lists
($fred, $barney) = ($barney, $fred); Swap the values of these two variables
@ references the entire array.
Note: When copying an array to another array, it is still the assignment of the list, but theseThe list is stored in
#!/usr/bin/perl-w
@lines = ' Perdoc-u-fatan2 '; Don't confuse anti-quotes with single quotes
foreach (@lines)
{
s/\w}+) >/\U$1/g;
Print
#print "Hello, world!\n"
}
Scalar is the simplest data type in Perl.
For most scalars, it is either a number
An expression
Grammar
Description
Any one character
.
Matches any one character except for the newline characters.
Up to 0 items or more
*
Matches 0 or more search items for the preceding
Perl installation module can use the CPAN command, but usually we do not have root user rights, so we can only install the module in sudo mode.For example, to install the Net::scp::expect module,Execute cpan net::scp::expectThe first use of the CPAN
######################################## Just use for practice #################################### ####! /Usr/bin/perl # use warning # Use diagnostics; # Use diagnositc # Use warnings; # use warning # use strict; # use strict # This means you must
######################### 1001 ############## ################
Use 5.010; while (<>) {my @ num = split; say $ num [0] + $ num [1];}
######################### 1048 ############## ################
My $ n = 12; my $ sum = 0; while ($ n --) {chomp
When Perl evolved to Perl 5, we had to consider the original hash design: the hash key value must be a scalar. The solution is to use 'quot '.
A 'quot' is a scalar value pointing to a complete list or a complete hash (or pointing to something else,
Recently, I had a program to automatically capture data from some BT websites and post it to my own forum. It worked better after a few months of trial, now the source code is published for reference by Perl enthusiasts. QQ is 2637663 and we welcome
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