- The scalar quantity (Varibale) begins with the dollar sign ($), which also becomes the magic symbol (SIGIL). Perl uses a magic character to differentiate what type of variable it is.
- Most of the variable names in Perl are used in all lowercase . The use of all-uppercase (such as $ARGV) generally represents a variable of special significance.
- Scalar variable interpolation (also called double-quote interpolation)in a string: $meal = "abc";
$barney = "Fred ate a $meal"
or $barney = "Fred ate a ${meal}"
- Be sure to add the curly braces {} that represent the wiring around the code block in the conditional statement.
- $line = <STDIN>;
- A list refers to an ordered set of scalars, which refers to data; An array is a variable that stores a list and refers to a variable.
- The last array index value of the array is $ #name, or 1 (negative array index value, 1 for the last one).
- (1.. 100) represents a list of 1 to 100 components ... is the range operator (range operator) and can only be small to large.
- QW (Fred Barney Betty) is equivalent to ("Fred", "Barnet", "Betty") to save a lot of meaningless quotes.
- ($rocks [0], $rocks [1], $rocks [2]) is equivalent to @rocks.
perl--Learning Record (real-time update)