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
Syntax
There are only two ways to create a 'quot.
Create reference
Create Rule 1If you add a '/' sign before a variable, you will get the 'quota' of the variable '.
$ Aref = // @ array; # $ Aref saves the 'quot' pointing to @ Array'$ Href =/% hash;
The previous article lists the similarities and differences between the ways of objects and JS in Perl. This continues to complement the array, the hash of the associated operation.
One, array
You can add additions and deletions to the array.
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
What is Perl?
Perl is a free and open-source scripting language created by Larry Wall. This language is mainly intended for practical and rapid development,
Structured Programming is incompatible with the popular object-oriented programming.
I. Hash Variables
A hash variable is also called an associated array. Like an ordinary array, you can use a subscript to access the data elements. The difference is that the subscript of a hash variable can not only be a non-negative integer, it can
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
Part I Programming Perl 1 Perl Data Types 1.1 Funny Characters
Type
Character
Example is
a name for:
Scalar
$
$cents
An individual value (number or string)
Array
@
@large
GrammarThere are only two ways to create ' references ', and they are two.
Creating references
Create Rule 1If you add a '/' number in front of a variable, you get a ' reference ' to the variable.
$aref =/@array; # $aref Keep a ' reference ' to
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.