About the origins and characteristics of Perl and Python
Perl is the abbreviation of practical extraction and report Language, created by Larry Wall in 1987, originally designed to facilitate the processing of reports on UNIX, and has become a fully
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
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
Incident
I rummaged over the books that spread the case. These books are all about programming and system management. After so many years of working as a programmer, there have been countless projects and software. Every new friend asks me this
Variable scope(a) package variables$x = 1Here, $x is a package variable. There are 2 important things to know about package variables:1) If there is no other declaration, the variable is the package variable;2) package variables are always
In writing a shell script, there may be a situation when you need to take a path of two paths. So, you need to use conditional statements to make the program make the right decisions and perform the right actions.
The UNIX shell supports conditional
Open a file using the Open () function
Common methods to open a file are:
Copy codeThe Code is as follows: open (FH, "Or die "Couldn't open $ filename for reading: $! ";
The open () function usually has two parameters. The first is the file handle,
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/
Python013 Python3 loop statement, python013python3
Python3 loop statementThis section describes how to use Python loop statements.The loop statements in Python include for and while.The control structure of the Python loop statement is as
Transferred from: superdebug.blog.chinaunix.netReplaceReplace Foo in all C programs with bar and old files back to. bakPerl-p-i.bak-e ' s/\bfoo\b/bar/g ' *.cVery powerful features, especially refactoring in large programs. I remember it was only
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.