summaryrefslogtreecommitdiff
path: root/Changes
blob: b8fb52f99e5c672f3fada0055a179f33974cbcfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
Incompatibilities
-----------------
    s'$lhs'$rhs' now does no interpolation on either side.  It used to
    interplolate $lhs but not $rhs.

    The second and third arguments of splice are now evaluated in scalar
    context (like the book says) rather than list context.

    Saying "shift @foo + 20" is now a semantic error because of precedence.

    "open FOO || die" is now incorrect.  You need parens around the filehandle.

    The elements of argument lists for formats are now evaluated in list
    context.  This means you can interpolate list values now.

    You can't do a goto into a block that is optimized away.  Darn.

    It is no longer syntactically legal to use whitespace as the name
    of a variable.

    Some error messages will be different.

    The caller function now a false value in a scalar context if there is
    no caller.  This lets library files determine if they're being required.

    m//g now attaches its state to the searched string rather than the
    regular expression.

New things
----------
    The -w switch is much more informative.

    References.  See t/op/ref.t for examples.

    Objects.  See t/op/ref.t for examples.

    => is now a synonym for comma.  This is useful as documentation for
    arguments that come in pairs, such as initializers for associative arrays,
    or named arguments to a subroutine.

    All functions have been turned into list operators or unary operators,
    meaning the parens are optional.  Even subroutines may be called as
    list operators if they've already been declared.

    More embeddible.  See main.c and embed_h.SH.

    The interpreter is now flattened out.  Compare Perl 4's eval.c with
    the perl 5's pp.c.  Compare Perl 4's 900 line interpreter loop in cmd.c
    with Perl 5's 1 line interpreter loop in run.c.  Eventually we'll make
    everything non-blocking so we can interface nicely with a scheduler.

    eval is now treated more like a subroutine call.  Among other things,
    this means you can return from it.

    Format value lists may be spread over multiple lines by enclosing in
    curlies.

    You may now define BEGIN and END subroutines for each package.  The BEGIN
    subroutine executes the moment it's parsed.  The END subroutine executes
    just before exiting.

    Flags on the #! line are interpreted even if the script wasn't
    executed directly.  (And even if the script was located by "perl -x"!)

    The ?: operator is now legal as an lvalue.

    List context now propagates to the right side of && and ||, as well
    as the 2nd and 3rd arguments to ?:.

    The "defined" function can now take a general expression.

    Lexical scoping available via "my".  eval can see the current lexical
    variables.

    Saying "package;" requires explicit package name on global symbols.