Perl substr () Function example, substr () function instance code-returns the substring of expr, starting with offset within the string.
Grammar:
Substr EXPR, OFFSET, LEN, replacementSubstr EXPR, OFFSET, LENSubstr EXPR, OFFSET
Definitions and
I. Data Types(Data type):
Perl has four data types: Scalar (variable), Scalar Array (Array), Hash Array (Hash), and References (pointer ), it seems to be rare, but it is more than enough to use it. Especially when writing Perl programs, you do not
one. DataType (data type ):Perl's data types are roughly four: Scalar (variables), Scalar Array (array), hash array (hash), References (pointer), but they seem to be small but more than sufficient. In particular, you can write a Perl program without
Before studying the basics of Perl, we would like to have a chance to see the following Perl introduction. Baidu Encyclopedia
First, basic types of Perl
The basic type of per is divided into two types: numeric type and string type.
Numeric types can
Here is the DNA sequence, stored under window F:\perl\data.txt:
Copy Code code as follows:
Aaaaaaaaaaaaaagggggggttttcccccccc
Cccccgtcgtagtaaagtatgcagtagcvg
Ccccccccccggggggggaaaaaaaaaaaaaaattttttat
Aaacg
Here's the
With the in-depth development of network security requirements, network-based intrusion detection technology has become an important and interesting research direction. Want to learn NIDs technology in addition to read some ready-made information
first, open, close the file
The return value of open is used to determine whether the operation that opened the file succeeds, returns a value other than 0 when it succeeds, and returns zero when it fails, so it can be judged as follows:if (Open
Process processing functions
1. Process Start functionFunction name EvalCall Syntax eval (string)The commentary considers a string as a Perl statement execution.When executed correctly, the system variable $@ is an empty string, and if there is an
Perl language learning notes 9 Regular Expressions for text processing, perl Language Learning
1. Replacement
S/PATTERN/REPLACE/; # returns the Boolean value of whether the replacement is successful.
You can use capture variables, such as s/(\ w)/$1/
Let's take a look at scalar operators. scalar can be divided into two types: Numbers and strings. In Perl, these two types of data can be converted to each other, but operations are different.
The following describes the numeric operators:
There
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.