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