Perl Learning 0515

Source: Internet
Author: User
Tags chr ord scalar

Creating characters with code points

$alef = Chr (0x05d0);
$alpha = Chr (Hex (' 03b1 '));
$omega = Chr (0X03C9);

You can convert a string to a code point by using the Ord () function:
$code _point = Ord ('? ');


Comparing numeric strings
Equal = = EQ
Unequal! = NE
Less than < LT
Greater than > GT
Less than or equal to <= le
Greater than or equal to >= ge

If control structure

You must add the bounds of the curly braces around the code block in the conditional statement, which differs from the C language.


Boolean value

If it is a number, 0 is false; All the other numbers are true.
If it is a string, the empty string (') is false and all other strings are true.
If neither a number nor a string, convert to a number or string before judging.

Note: The string ' 0 ' is the same scalar as the number 0, so Perl treats them equally. In other words, the string ' 0 '
is the only non-empty string that is considered false.

A list refers to an ordered set of scalars, whereas an array is a stored
List of variables.

A list refers to the fact data, whereas an array refers to a variable.

undef value
Undef is neither a number nor a string, it is simply a scalar value of another type.


List Direct Quantity
(1.. ) #100个整数构成的列表

QW Shorthand

Just use QW shorthand to save yourself the hassle of typing a lot of meaningless quotes.


P73


Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.