1. Unless statement, if is executed when the condition is true, unless is executed when the condition is false
2. abbreviation statement. & error ("invalid input") Unless & valid ($ input); $ I * = 2 unitl $ I> $ J; print "", ($ n + = 2) while $ n <10; & Greet ($ _) foreach @ person;
3. the bare block, which usually provides scope for temporary variables.
4. Although there is no switch, we have elsif. Note that it is neither else if nor elseif.
5. Calculate the square root of SQRT
6. Use last to exit the loop, similar to break; next and continue...
7. Redo, it will be adjusted to the top of the current loop block, without the conditional expression judgment and the functionality of this loop...
8. You can add tags to the outer loop and jump out of the loop... powerful! It also means goto is more =. =
9. Put the judgment of whether the divisor is 0 on the left of the & operation, which can be used to prevent the divisor from being 0... this method is good... short-circuit operation
If ($ n! = 0 & $ total/$ n <10 )...
10. In Perl, short-circuit operations do not always return true/false, for example, my $ last_name = $ last_name {$ someone} | 'no last name ';
If $ someone is not in hash, assign a value...
11. The usual method to open a file in Perl is:
Open chapter, $ filename or die "can't open '$ filename': $! ";