1. Search by index in a string $ Where = index ($ words, $ word );# Find the place where word appears for the first time from words. The subscript starts from 0. If the search fails,-1 is returned; Specify where to start searching: $ where = index
Implicit inheritance in Perl
Implicit inheritance
Today, I saw a disconnection. Code : A. PM Code: [copy to clipboard] Package; ... Sub test {Print "test \ n ";} B. PM Code: [copy to clipboard] Package B;Use; B-> test (); I think it is
Perl $ sig {alrm} processing service timeout #! /Usr/bin/perl some_sub (); sub some_sub { eval { Local $ sig {alrm} = sub {die "died in SIG alrm ";}; # timeout processing alarm (1); # If the following Code is not completed after 1 second, the
()GroupExample: ($ fruit, $ color) =/(. *)/SIS/s (.*)/;Values in each bracket are returned values in the list.
= ~This operator does not assign values. It just extracts the operator on the right and enables it to operate on the variables on the
Original article link
References
CPAN mirror Configuration
CPAN tutorial
Perl 5 tutorial
Perl has added the concept of modules to the fifth edition to provide Object-Oriented Programming capabilities. This is the history of
$ Refers to one, @ refers to a bunch, and % refers to hash --------------------------------------------------- X string repetition operator. eg: "Fred" x 3 = "fredfred" ------------------------------------------------------ Array: $ # Index
Null Value Judgment
$ T {type1id }=$ $ Pref {DBH}-> selectrow_array ("select type1id from enq1 where id =
3 ");
If ($ t {type1id} = 0 ){
Print "type1id is null \ n ";
}
==> This statement is incorrect if it is not a numerical value. Special
I haven't written a Perl script for a long time. Recently, my computer has the prison break audio and SRT lyrics. However, the lyrics are incorrect. After the script is processed, you can change your voice to subtitles. It is mainly used to review
Conversion from: Protocol (Practical Extraction and report language), PHP (Hypertext Preprocessor), ASP (Active Server Pages), JSP (assumerver pages) for some technical comparison. Perl (Practical Extraction and Report Language) is a very old
1. Install Perl-LDAP: Http://search.cpan.org /~ Gbarr/perl-ldap/The premise is that you have installed the Perl toolkit. First, check the Perl version.[Root @ local ~] Perl-VBuilt under LinuxCompiled at Nov 8 2007 06:49:06@ INC:/Usr/lib64/perl5/site_
The company's billing is not based on access logs. However, the original access logs are the most trusted resources,
It is often used to test various parameters, such as traffic.
Log format:
222.85.90.158--[01/SEP/2012: 00: 00: 00 +
Processing of scalar or constantI. Objective and result storage:The target content of the default operation is in the default variable $ _, and the operation result is stored in $ _. If the operation succeeds $1, $2, $3, $ @ the variable also saves
Posted on Netease blog 21:18:43
Start learning Perl.
(What interests me about Perl is the little alpaca book. Er, this is the alpaca, but how does it feel like a god beast on the Internet .)
2.1-2.3 Calculation of circle radius
#! Perl-W$ Pi = 3.1415
Chapter 2: subprocesses/functions
Declaration: subfunction_name;
Definition: subfunction_name {...}
Function call is the same as C:
Example_subroutine (); or example_subroutine;
Example_subroutine ('perl is ', 'my favorite', $
I. Process processing functions
1. Process startup Function
Function Name eval
Call the syntax eval (string)The description regards string as a Perl statement execution.After the command is correctly executed, the system variable $ @ is an empty
Copy codeThe Code is as follows :#! /Bin/perl
Print "please input some lines, then press Ctrl + Z. \ n ";
Chomp (@ s = );
Print "1234567890" x 3. "\ n"; # serves as a yardstick for output results.
Foreach $ s (@ s)
{
Printf "% 20s \ n", $ s; # The
Basic usage
# Initialize % h as an empty array % h = {};# Use an array to initialize % h as a => 1, B => 2% h = ('A', 1, 'B', 2 );# The meaning is the same as above. It is just a more Visualized Method. % H = ('A' => 1, 'B' => 2 );# If the key is a
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