|
1 | | - |
| 1 | +Incompatibilities |
| 2 | +----------------- |
2 | 3 | s'$lhs'$rhs' now does no interpolation on either side. It used to |
3 | 4 | interplolate $lhs but not $rhs. |
4 | 5 |
|
5 | 6 | The second and third arguments of splice are now evaluated in scalar |
6 | 7 | context (like the book says) rather than list context. |
7 | 8 |
|
8 | | - Saying shift @foo + 20 is now a semantic error. |
| 9 | + Saying "shift @foo + 20" is now a semantic error because of precedence. |
| 10 | + |
| 11 | + "open FOO || die" is now incorrect. You need parens around the filehandle. |
9 | 12 |
|
10 | 13 | The elements of argument lists for formats are now evaluated in list |
11 | | - context. |
| 14 | + context. This means you can interpolate list values now. |
12 | 15 |
|
13 | | - You can't do a goto into a block that is optimized away. |
| 16 | + You can't do a goto into a block that is optimized away. Darn. |
14 | 17 |
|
15 | 18 | It is no longer syntactically legal to use whitespace as the name |
16 | 19 | of a variable. |
17 | 20 |
|
18 | 21 | Some error messages will be different. |
| 22 | + |
| 23 | + The caller function now a false value in a scalar context if there is |
| 24 | + no caller. This lets library files determine if they're being required. |
| 25 | + |
| 26 | + m//g now attaches its state to the searched string rather than the |
| 27 | + regular expression. |
| 28 | + |
| 29 | +New things |
| 30 | +---------- |
| 31 | + The -w switch is much more informative. |
| 32 | + |
| 33 | + References. See t/op/ref.t for examples. |
| 34 | + |
| 35 | + Objects. See t/op/ref.t for examples. |
| 36 | + |
| 37 | + => is now a synonym for comma. This is useful as documentation for |
| 38 | + arguments that come in pairs, such as initializers for associative arrays, |
| 39 | + or named arguments to a subroutine. |
| 40 | + |
| 41 | + All functions have been turned into list operators or unary operators, |
| 42 | + meaning the parens are optional. Even subroutines may be called as |
| 43 | + list operators if they've already been declared. |
| 44 | + |
| 45 | + More embeddible. See main.c and embed_h.SH. |
| 46 | + |
| 47 | + The interpreter is now flattened out. Compare Perl 4's eval.c with |
| 48 | + the perl 5's pp.c. Compare Perl 4's 900 line interpreter loop in cmd.c |
| 49 | + with Perl 5's 1 line interpreter loop in run.c. Eventually we'll make |
| 50 | + everything non-blocking so we can interface nicely with a scheduler. |
| 51 | + |
| 52 | + eval is now treated more like a subroutine call. Among other things, |
| 53 | + this means you can return from it. |
| 54 | + |
| 55 | + Format value lists may be spread over multiple lines by enclosing in |
| 56 | + curlies. |
| 57 | + |
| 58 | + You may now define BEGIN and END subroutines for each package. The BEGIN |
| 59 | + subroutine executes the moment it's parsed. The END subroutine executes |
| 60 | + just before exiting. |
| 61 | + |
| 62 | + Flags on the #! line are interpreted even if the script wasn't |
| 63 | + executed directly. (And even if the script was located by "perl -x"!) |
| 64 | + |
| 65 | + The ?: operator is now legal as an lvalue. |
| 66 | + |
| 67 | + List context now propagates to the right side of && and ||, as well |
| 68 | + as the 2nd and 3rd arguments to ?:. |
| 69 | + |
| 70 | + The "defined" function can now take a general expression. |
| 71 | + |
| 72 | + Lexical scoping available via "my". eval can see the current lexical |
| 73 | + variables. |
| 74 | + |
| 75 | + Saying "package;" requires explicit package name on global symbols. |
0 commit comments