perl 5.0 alpha 3
[p5sagit/p5-mst-13.2.git] / Changes
CommitLineData
93a17b20 1Incompatibilities
2-----------------
79072805 3 s'$lhs'$rhs' now does no interpolation on either side. It used to
4 interplolate $lhs but not $rhs.
5
6 The second and third arguments of splice are now evaluated in scalar
7 context (like the book says) rather than list context.
8
93a17b20 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.
79072805 12
13 The elements of argument lists for formats are now evaluated in list
93a17b20 14 context. This means you can interpolate list values now.
79072805 15
93a17b20 16 You can't do a goto into a block that is optimized away. Darn.
79072805 17
18 It is no longer syntactically legal to use whitespace as the name
19 of a variable.
20
21 Some error messages will be different.
93a17b20 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
29New 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.