Chapter 2: List and array list
(): Empty list, false when used as a condition judgment
Two non-empty list examples: ("hello", "world", "\ n") (123,456,789)
Different types of elements can be contained in the same list.
The list in Perl is only one-dimensional. (3, 8, 5, 15), (3, 8), (
Application of Regular Expressions
1. // is short for M //./http: // is not easy to read. You can write m {http: //} or M % http: // %
2. The forward slash is not a metacharacter. If it is not a separator, you do not need to use a backslash before it.
3./Fred/I, indicating that the case sensitivity is ignored. It can match Fred, etc.
4 .. line breaks cannot be matched, but after S is added, all characters, such as/f. */s, can be matched to all strings starting with F
Chapter 5 using Perl for CGIProgramming• This chapter introduces the commonGateway Interface (CGI) and discussesHow Perl can be used as a CGIProgramming Language. It begins withOverview of CGI, how CGI programs areLiked to web clients, and how resultsAre returned to clients from CGI programs.• You'll also learn in this chapter aboutCGI. PM module, which provides
So that some characters (especially wide characters) cannot be correctly displayed, that is, they are no longer in UTF-8 format.
Solution:When the output file is opened, the encoding format is specified, so no garbled characters will occur after the output file is opened.
Common default open output files:
Copy codeThe Code is as follows: open (OUTPUT, '> output.txt') | die "can not open the file: $! ";
Define the specified encoding format file (or
Perl Learning 5 Hash, perllearninghash
[This article is original. Do not reprint it without permission]
Hash is a data structure. It is similar to an array in that it can accommodate any number of values and can be used as needed. The difference between hash and array lies in the indexing method, arrays are indexed by numbers, while hash is indexed by names. That is to say, the hash index value, which is c
Install the perl module in CentOS 5 to support IPV6
LWP: UserAgent is used in our product for http requests in perl code. The test shows that the following error is returned in a pure V6 environment:
Can't connect to [2001: db8: 0: 1: 10: 208: 135: 232]: 8002 (Bad hostname '[2001: db8: 0: 1: 10: 208: 135: 232] ')
After investigation, we found that some
In order to omit the space and make it visible to the operator who manually fills in the paper, the volume number on the card of the materials shelf is determined to be classified and sorted, as shown in
A-3, A-4, A-5, A-8 forming A-3 ~ 5, 8, etc.
The following code uses a few auxiliary list
/// /// Similar to 1, 2, 3
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, such as insufficient permissions and the file does not exist. The information contained in it is only valid when the system request fails.4. As a general rule (die statement), if a usage error occurs, a line break is added to the message. If it is anothe
/***//**
* Fractionserial. Java
* There is a fractional sequence: 2/1, 3/2, 5/3, 8/5, 13/8, 21/13...
* Calculate the sum of the first 20 items of the series.
* @ Author Deng Chao (codingmouse)
* @ Version 0.2
* Development/test environment: jdk1.6 + eclipse SDK 3.3.2
*/
Public class fractionserial ...{
Public static
# Include
}/* The numerator behind the score is equal to the numerator plus the denominator of the previous score, and the denominator of the subsequent score is equal to the numerator with the previous score */
There is a fractional sequence: 2/1, 3/2, 5/3, 8/5, 13/8, 21/13... find the sum of the first 20 items of
There is a fractional sequence of 2/1 + 3/2 + 5/3 + 8/5 + 13/8 +... Find the sum of the first 20 items of the series.Program:
# Include
Output result: 32.660261 Press any key to continue
C language: There is a score sequence: 2/1 + 3/2 + 5/3 + 8/5 + 13/8 +... Find the sum of the first 20 items in this seriesProgram:
# Include
Output result: 32.660261 Press any key to continue
This allows some characters (especially wide characters) to be displayed incorrectly, which is no longer utf-8 format.
Solution:When you open the output file, you specify the encoding format, and there is no garbled situation after the output file is opened.
The normal default open output file:
Copy Code code as follows:
Open (OUTPUT, ' >>output.txt ') | | Die "Can not open the file: $!";
Defines the specified encoding format file (o
I'm doing something with Perl+mdbm+spread recently.
PHP has been used for a long time, Python and Ruby have been used, the classic scripting language has not been touched by Perl, now in the same way as a pupil holding a textbook gnawing.
It's a lot harder to find Perl. Something else didn't make me make a mistake so often.
1. The first common mistake is to
[USA]web44 free 300M can be bound m php space applicationMonthly flow limit of: 10GB;
Support PHP, and provide 5 MySQL database;
Support Web/ftp way to upload and manage filesAddress: http://web44.co.cc
American Cashfreeweb offers 250MB free php space
Application Address: http://cashfreeweb.com/
FREEO provides 275MB ftp free PHP space
adopt Vistapanel Management panel;
You can install a PHP program online;
Application Address: http://freeo.net
Tags: blog OS AR for div SP log c AMP In Perl, The chdir function is used to change the current working directory to the specified directory. If no directory is specified, it goes to the user's main directory. This function calls the CD command in UNIX to switch directories. Here is a specific example to illustrate how chdir works. Use strict; Use warnings; # print all files in a directory sub print_files {my $ dir = 'd:/Code'; opendir Dir, $ DIR or
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.