. Represents any single character and does not match the linefeed.* Is A quantizer, indicating that the previous content appears 0 to multiple times.+ It is also a quantizer, indicating that the previous content appears one to multiple times.
Comparison of Perl use and require usage
Comparison (1) Description:Both functions mean loading and referencing Perl modules, or sub-functions.Program,
The difference is that Perl use is searched in the current default. Once the module is not in
. 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)
Http://developer.51cto.com/art/201007/213719.htm
Http://www.ibm.com/developerworks/cn/linux/sdk/perl/culture-4/index.html
Http://www.sdsc.edu /~ Moreland/courses/introperl/docs/manual/pod/perldebug.html # Name
The default Perl debugger is
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,
Recently I used Perl to write a lot of automated testing tools. I have used some modules and I think it is quite good to record them. I may need to use them in the future.
Smart: CommentsSmart comments provides debugging and tracingCodeYou can
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
1. System ("command ");Use this command to enable a sub-process to execute the command in quotation marks. The parent process will wait until the sub-process ends and continue to execute the following code.
2. Exec ("Command ");The effect is
Refer to a simple regular expression test program in Perl Getting Started:
1 #! /Usr/bin/perl 2 Use warnings; 3 use strict; 4 5 my $ pattern = $ argv [0]; 6 if (not $ pattern) {7 print "Usage :. /ret. PL pattern \ n "; 8 exit; 9} 10 print" the
Previously, I used Scala and go to write a crawler. I recently read Perl and I will write a version with the same functions. Use the lwp: simple module and install it with CPAN lwp (Ubuntu 13.04 does not provide this important module with Perl,
On the console, enter perldoc perldebug to learn how to debug the Perl program.
The important commands are as follows:
P expr same as "Print {$ DB: Out} expr" in the current package. InParticle, because this is just Perl's own "print"Function,
1. Question
There are some problems described in the original question. Question 1st: match the row containing fred. Question 2nd: match the rows containing fred or Fred. Question 3rd: match the row containing the vertex number. Question 4th: match
Http://hi.baidu.com/jackywdx/blog/item/35bb33daedb414dfb7fd4867.html
LWP: Simple Function
1. How to use this module in Perl?
Use LWP: Simple;
2. How to get a page content?
My $ content = get ('HTTP: // www.yahoo.com.cn ');
1. Search for existing modulesHttp://search.cpan.org/
2. Input an XML query and select a module that has a high rating and can meet your needs:XML: SimpleUse warnings;Use XML: Simple;Use Data: Dumper;
# Converting XML files into Hash results
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
Special symbols of Perl
@ Array$ X {} x is preceded by the dollar sign ($), followed by curly braces ({}), and is a hash element.% To reference the entire hash, use the percent sign (") as the prefix. The hash name used in the previous pages 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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service