######################################## #################### Function: Get the current time# Parameter: None# Return Value: return time in the format of yyyymmddhhmmss######################################## ###################Sub get_time{My ($
Perl built-in variables:-01-04 are Perl built-in variables that you know. If you have any missing variables, post them to add them:
$-Number of printable lines on the current page, part of the perl format system$! Returns the error code or string
the conversion between Perl Chinese/Unicode/utf8/gb2312 encoding is a headache. I have summarized the following conversion methods for your reference.
# Author: jiangyujie Use utf8; Use encode; Use URI: escape; $/= "/N"; # utf8 encoding
Our project has many testing platforms, including Windows and Linux. Linux provides an unzip command for decompression, but it is troublesome in windows. in Windows 2000, no command is provided to decompress the file. In XP, The unzip command is
. 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)
Perl supports generating documents from text blocks in your pod format. This pod text block can be embedded in
CodeOr a separate file.
With the pod, It is very convenient to write a script without having to write additional documents.
We
1. Tag extraction in HTML
])*>
2. Extract the URL and link text in the label.
While ($ html = ~ M {A \ B ([^>] +)> (.*?) }ig) {my $ guts = $1; my $ link = $2; if ($ guts = ~ M {\ B href # href attribute \ s * = \ s * # A blank character (? : #
Address: http://blog.csdn.net/omohe/article/details/1562515
To read a string from a file using Perl, you can use either of the following methods:
1. Read all the content in the file into an array at a time (this method is suitable for small files
The source code is as follows:
C # code
[Webmethod]
Public String Hello (){Return "Hello World ";
}
Perl code 1:#! /Usr/bin/perl-W
Use strict;Use soap: lite;
Print soap: Lite-> Uri ('HTTP: // tempuri.org ')-> On_action (sub {sprintf '% S/%
Sometimes you will receive an anonymous phone number that is "immediately hung up after the phone call". Sometimes you don't pay attention to it. There are several "missed phone calls" on
Index (primary string, substring) starts from 0 and returns the position of the most recent substring in the primary string.
Rindex (Main string, sub-string) Searches from the end and returns the position of the most recent sub-string in the main
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,
Posted on Netease blog 13:10:11
1st print the last name based on the entered person name
#! Perl-W# GetfamilynameUse strict;My % nametable = ("Fred" => "Flintstone", "Barney" => "rubble", "Wilma" => "Flintstone ");Print "input person name, and the
I am sorry to send a personal advertisement here. If you are interested, you can view it:Http://www.wachnew.com
#! /Usr/bin/perl-W
$ Family_name {"Fred"} = "flinkstone"; # assign a value to the hash key$ Family_name {"Barney"} = "rubble ";
Foreach
Trusted CT. PM module: Mainly used to interact with another server, such as FTP and telnet. It is also frequently used in writing monitoring data.The method I used is very simple,Spawn ($ command, @ Params), forks and execs $ command. returns an
I also saw it in another blog, but I cannot find it on the Internet now. Fortunately, I recorded it:
If you use Carbide to compile any project, the following error occurs:=== Build command =/C abld build winscw udeb-V
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,
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
Shell: an interface that directly interacts with the Linux kernel. It is relatively basic and used to process basic and simple tasks, such as batch processing.Perl: it is more complex and powerful than shell, and has a powerful regular expression
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