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
Read the document: After HTTP://SEARCH.CPAN.ORG/~GAAS/DIGEST-MD5-2.39/MD5.PM,
Very useful Chapter paragraph:
This is useful if calculating checksum for files:
Use DIGEST::MD5;
My $file = Shift | | "/ETC/PASSWD";
Open (FILE, $file)
Use base is object-oriented programming, used to describe the "base class", in fact, plainly,Use base somemodule;is equivalent to a combination of the following two sentences:begin{Use Somemodule ();Push @ISA, QW (Somemodule);}You can also use base
The length of the Perl array and the number of elements $ #数组名---represents the subscript of the last element in the array, which equals the number of elements minus 1. The @ array name---Represents the number of elements in the array. $ scalar
It is convenient to read and write Excel files in Perl.CodeFor future reference.
To read and write Excel components, you must install the following commands:
Perl-mcpan-e shell-> install Spreadsheet: writeexcelPerl-mcpan-e shell-> install
Scope is the valid range and visible range of variables. variables are valid only in scope;
In Perl, data scopes are classified into global scopes, lexical scopes, and dynamic scopes. In PE rl5, variables and variable scopes can be declared using
For some strings, the input must be in a specific format. sprintf can be used for convenient processing, and no additional processing is required.
The usage of sprintf in Perl is as follows:
Sprintf format, list
For example:
$ Result =
#! /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:
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
What is a closure? "This is a notion Out Of The LISP world that says if you define an anonymous function in a particle lexical context, it pretends to run in that context even when it's called outside of the context. "[2 ]. In the object-oriented
This task counts the top 500 entries in a week.
Data source: from the Oracle database.
Requirement: generate an Excel file and send an email to the relevant person.
Because it was the first time that I was engaged in such a task (writing scripts on
Use a subroutine to remove the spaces at the beginning and end of each line read from the file. The print Value of the sub function is no longer blank, but the returned value is printed with spaces. The Code is as follows:
While ()
{
& Trim ($
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
Sorry, I saw the email in Gmail and then replied to the email directly. Then ...... "This is an automatic notification email. do not reply to this email directly ." Er ...... Paste it here.
Yes. What I am sending now is what I have. This part is
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.