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
1. Length of the array:
If you assign an array variable to a scalar variable, the length of the array is assigned to the scalar variable:
$ A = @ array; # The length of the array @ array is stored in the scalar variable $ A, that is, the number of
I. Introduction of the ModuleModule is the Perl package. The Perl object is based on a reference to the data item in the package.When you use object-oriented programming in other languages, you declare a class and then create an object (instance) of
Chapter 2: References
References are declared as scalar types (named variables starting with $), and reference is obtained using the \ operator.
Modifying the referenced variable is equivalent to modifying the reference pointing to the
There are five variables in Perl:
Scalar, pointer, array, hash and handle.
1. scalar
Let's take a look at scalar. scalar is the simplest data type in Perl. Variables of this data type can be numbers, strings, floating-point numbers, and are not
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
Perl object-oriented first let's take a look at the three basic definitions of Perl Object-Oriented Programming: 1. an "object" refers to a simple reference that "there is a way to know which class it belongs. (An object is a reference variable) 2.
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.