Mention parallel testing in INSTALL and perl5110delta.pod
[p5sagit/p5-mst-13.2.git] / pod / perl5110delta.pod
CommitLineData
7120b314 1=head1 NAME
2
3perldelta - what is new for perl v5.11.0
4
5=head1 DESCRIPTION
6
7This document describes differences between the 5.10.0 and the 5.11.0
9948897e 8development releases.
7120b314 9
10=head1 Incompatible Changes
11
8b8da387 12=head2 Switch statement changes
13
14The handling of complex expressions by the C<given>/C<when> switch
1710b4c0 15statement has been enhanced. There are two new cases where C<when> now
412304fb 16interprets its argument as a boolean, instead of an expression to be used
8b8da387 17in a smart match:
18
19=over 4
20
8b8da387 21=item flip-flop operators
22
23The C<..> and C<...> flip-flop operators are evaluated in boolean context,
24following their usual semantics; see L<perlop/"Range Operators">.
25
26=item defined-or operator
27
28A compound expression involving the defined-or operator, as in
29C<when (expr1 // expr2)>, will be treated as boolean if the first
30expression is boolean. (This just extends the existing rule that applies
31to the regular or operator, as in C<when (expr1 || expr2)>.)
32
33=back
34
35The next paragraph details more changes brought to the semantics to
36the smart match operator, that naturally also modify the behaviour
37of the switch statements where smart matching is implicitly used.
38
39=head2 Smart match changes
40
41=head3 Changes to type-based dispatch
42
43The smart match operator C<~~> is no longer commutative. The behaviour of
44a smart match now depends primarily on the type of its right hand
ee18cc6c 45argument. Moreover, its semantics has been adjusted for greater
46consistency or usefulness in several cases. While the general backwards
47compatibility is maintained, several changes must be noted:
8b8da387 48
49=over 4
50
51=item *
52
53Code references with an empty prototype are no longer treated specially.
54They are passed an argument like the other code references (even if they
55choose to ignore it).
56
57=item *
58
59C<%hash ~~ sub {}> and C<@array ~~ sub {}> now test that the subroutine
9091a618 60returns a true value for each key of the hash (or element of the
8b8da387 61array), instead of passing the whole hash or array as a reference to
62the subroutine.
63
64=item *
65
ee18cc6c 66Due to the commutativity breakage, code references are no longer
67treated specially when appearing on the left of the C<~~> operator,
68but like any vulgar scalar.
69
70=item *
71
8b8da387 72C<undef ~~ %hash> is always false (since C<undef> can't be a key in a
73hash). No implicit conversion to C<""> is done (as was the case in perl
745.10.0).
75
76=item *
77
78C<$scalar ~~ @array> now always distributes the smart match across the
79elements of the array. It's true if one element in @array verifies
80C<$scalar ~~ $element>. This is a generalization of the old behaviour
81that tested whether the array contained the scalar.
82
83=back
84
85The full dispatch table for the smart match operator is given in
86L<perlsyn/"Smart matching in detail">.
87
88=head3 Smart match and overloading
89
90According to the rule of dispatch based on the rightmost argument type,
91when an object overloading C<~~> appears on the right side of the
92operator, the overload routine will always be called (with a 3rd argument
93set to a true value, see L<overload>.) However, when the object will
94appear on the left, the overload routine will be called only when the
9091a618 95rightmost argument is a simple scalar. This way distributivity of smart match
8b8da387 96across arrays is not broken, as well as the other behaviours with complex
97types (coderefs, hashes, regexes). Thus, writers of overloading routines
ee18cc6c 98for smart match mostly need to worry only with comparing against a scalar,
99and possibly with stringification overloading; the other common cases
100will be automatically handled consistently.
8b8da387 101
102C<~~> will now refuse to work on objects that do not overload it (in order
103to avoid relying on the object's underlying structure).
104
7120b314 105=head1 Core Enhancements
106
ef55af2a 107=head2 The C<overloading> pragma
1839a850 108
109This pragma allows you to lexically disable or enable overloading
110for some or all operations. (Yuval Kogman)
111
71e9c532 112=head2 C<\N> regex escape
113
114A new regex escape has been added, C<\N>. It will match any character that
115is not a newline, independently from the presence or absence of the single
116line match modifier C</s>. (If C<\N> is followed by an opening brace and
117by a letter, perl will still assume that a Unicode character name is
118coming, so compatibility is preserved.) (Rafael Garcia-Suarez)
119
5ee651a9 120=head2 Parallel tests
121
122The core distribution can now run its regression tests in parallel on
123Unix-like platforms. Instead of running C<make test>, set C<TEST_JOBS> in
124your environment to the number of tests to run in parallel, and run
125C<make test_harness>. On a Bourne-like shell, this can be done as
126
127 TEST_JOBS=3 make test_harness # Run 3 tests in parallel
128
129An environment variable is used, rather than parallel make itself, because
130L<TAP::Harness> needs to be able to schedule individual non-conflicting test
131scripts itself, and there is no standard interface to C<make> utilities to
132interact with their job schedulers.
133
7120b314 134=head1 Modules and Pragmata
135
1839a850 136=head2 Pragmata Changes
137
138=over 4
139
140=item C<overloading>
141
142See L</"The C<overloading> pragma"> above.
143
144=back
145
7120b314 146=head1 Utility Changes
147
148=head1 Documentation
149
150=head1 Performance Enhancements
151
152=head1 Installation and Configuration Improvements
153
154=head1 Selected Bug Fixes
155
54ad55c5 156=over 4
157
158=item C<-I> on shebang line now adds directories in front of @INC
159
160as documented, and as does C<-I> when specified on the command-line.
161(Renée Bäcker)
162
163=back
164
7120b314 165=head1 New or Changed Diagnostics
166
167=head1 Changed Internals
168
169=head1 Known Problems
170
171=head2 Platform Specific Problems
172
173=head1 Reporting Bugs
174
175If you find what you think is a bug, you might check the articles
176recently posted to the comp.lang.perl.misc newsgroup and the perl
177bug database at http://bugs.perl.org/ . There may also be
178information at http://www.perl.org/ , the Perl Home Page.
179
180If you believe you have an unreported bug, please run the B<perlbug>
181program included with your release. Be sure to trim your bug down
182to a tiny but sufficient test case. Your bug report, along with the
183output of C<perl -V>, will be sent off to perlbug@perl.org to be
184analysed by the Perl porting team.
185
49f8307e 186If the bug you are reporting has security implications, which make it
187inappropriate to send to a publicly archived mailing list, then please send
188it to perl5-security-report@perl.org. This points to a closed subscription
189unarchived mailing list, which includes all the core committers, who be able
190to help assess the impact of issues, figure out a resolution, and help
191co-ordinate the release of patches to mitigate or fix the problem across all
192platforms on which Perl is supported. Please only use this address for security
193issues in the Perl core, not for modules independently distributed on CPAN.
194
7120b314 195=head1 SEE ALSO
196
197The F<Changes> file for exhaustive details on what changed.
198
199The F<INSTALL> file for how to build Perl.
200
201The F<README> file for general stuff.
202
203The F<Artistic> and F<Copying> files for copyright information.
204
205=cut