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
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
1. Simple Variables
==============
1. Integer$ X = 123456;Perl stores integer data in floating-point registers. In fact, integer variables are treated as floating-point numbers in Perl, but they are only a special column of floating-point data.The
Arithmetic operators: + (plus),-(minus), * (multiply),/(except), * * (Power),% (take more),-(Monocular negative)
(1) The cardinality of the power can not be negative, such as ( -5) * * 2.5 # error;
(2) The result of power can not exceed the limit of
Perl:Practical Extractionand Report Language, practical reports extraction language.Borrowing the features of C, sed, awk, Shell, and many other programming languages is the Dream scripting language for Linux and UNIX. Used primarily for text
To include double quotes or backslashes in the string, add a backslash before it, and the backslash can also cancel the variable substitution
Single quotes another feature that can span multiple lines, such as:$text = ' This is twoLines of text';is
1. Numeric Operators: + (Plus),-(minus), * (multiplication),/(Division), ** (multiplication party/power), % (remainder );These operators mix integers, floating-point numbers, and real numbers. The calculation results are in the correct numeric
One, arithmetic operators: + (plus),-(minus), * (multiply),/(except), * * (UP),% (remainder),-(Monocular negative)
(1) The base of the exponentiation can not be negative, such as ( -5) * * 2.5 # error;(2) The result of a exponentiation cannot exceed
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.