1.Perl the general variable into a scalar, the variable can refer to the direct amount of two kinds: the number of direct volume, string direct.
A) The string representation method:
Single quotes, the strings in single quotes are intuitive and do not require variable values and escape characters;
Double quotes requiring variable values and escape character values.
If you need to eliminate it, you usually need to add a backslash in front of it, either single or double quotes.
B In addition, QQ or q can be used instead of double quotes or single quotes, the boundary character can be used in pairs (), <>, {}, [] and so on.
2. Scalar variables :
$ plus variable name (array using @, hash structure using%); variable names are case-sensitive; you do not need to declare them before using a scalar but initialize them.
Some special scalar quantity:
$_, $ ", $/, $, $$, $! , their values are usually used as "default values." If the $_ is used as the default value for the output, $! is used as the default value for the error.
3. Expressions and Operators :
1), the warning #! in Perl /usr/bin/perl/-W, or use warnings;
2), the number operator: except/, the remainder%, take power 4**3=64
3, string operator: the operator of the $c = $a. $b;) The interpolation substitution of the variable in double quotation marks can also be used for the insert operation, if the $ is canceled before the backslash is added. Repeat operator x (such as $line = "_" x 7)
4), with the name of the operator: int to take the integer part of length, LC conversion to lowercase, UC conversion to uppercase, Rand from 0 to the random number of parameter values; Cos, more Perldoc
5), the angle bracket operator:<> a row in the handle, for example, <STDIN> reads a row from the keyboard of a standard input device and reads one row,<file> from a file handle, chomp $line; Deletes the end line break.