Commit | Line | Data |
d5114285 |
1 | =head1 NAME |
2 | |
d5114285 |
3 | perldelta - what is new for perl v5.11.2 |
4 | |
5 | =head1 DESCRIPTION |
6 | |
7 | This document describes differences between the 5.11.1 release and |
8 | the 5.11.2 release. |
9 | |
d5114285 |
10 | =head1 Core Enhancements |
11 | |
97352077 |
12 | =head2 qr overloading |
13 | |
14 | It is now possible to overload the C<qr//> operator, that is, conversion |
15 | to regexp, like it was already possible to overload conversion to |
16 | boolean, string or number of objects. It is invoked when an object |
17 | appears on the right hand side of the C<=~> operator, or when it is |
18 | interpolated into a regexp. See L<overload>. |
19 | |
88e1f1a2 |
20 | =head2 Pluggable keywords |
21 | |
22 | Extension modules can now cleanly hook into the Perl parser to define new |
c54f4355 |
23 | kinds of keyword-headed expression and compound statement. The syntax |
24 | following the keyword is defined entirely by the extension. This allow |
88e1f1a2 |
25 | a completely non-Perl sublanguage to be parsed inline, with the right |
c54f4355 |
26 | ops cleanly generated. This feature is currently considered experimental. |
88e1f1a2 |
27 | |
c54f4355 |
28 | See L<perlapi/PL_keyword_plugin> for the mechanism. The Perl core source |
88e1f1a2 |
29 | distribution also includes a new module L<XS::APItest::KeywordRPN>, which |
30 | implements reverse Polish notation arithmetic via pluggable keywords. |
31 | This module is mainly used for test purposes, and is not normally |
32 | installed, but also serves as an example of how to use the new mechanism. |
33 | |
72343ccb |
34 | =head2 Lexer API |
35 | |
36 | We have added a public API for the lowest layers of lexing. This is meant |
37 | to provide a solid foundation for the parsing that Devel::Declare and |
38 | similar modules do, and it complements the pluggable keyword mechanism. |
39 | The API consists of some existing variables combined with some new functions, |
40 | all marked as experimental (which making them public certainly is). |
41 | |
580561a3 |
42 | =head2 APIs for more internals |
43 | |
44 | The lowest layers of the lexer and parts of the pad system now have C |
c54f4355 |
45 | APIs available to XS extensions. These are necessary to support proper |
46 | use of pluggable keywords, but have other uses too. The new APIs are |
580561a3 |
47 | experimental, and only cover a small proportion of what would be necessary |
c54f4355 |
48 | to take full advantage of the core's facilities in these areas. It is |
580561a3 |
49 | intended that the Perl 5.13 development cycle will see the addition of |
50 | a full range of clean, supported interfaces. |
51 | |
f7461760 |
52 | =head2 Overridable function lookup |
53 | |
c54f4355 |
54 | Where an extension module hooks the creation of rv2cv ops to modify |
f7461760 |
55 | the subroutine lookup process, this now works correctly for bareword |
c54f4355 |
56 | subroutine calls. This means that prototypes on subroutines referenced |
57 | this way will be processed correctly. (Previously bareword subroutine |
f7461760 |
58 | names were initially looked up, for parsing purposes, by an unhookable |
59 | mechanism, so extensions could only properly influence subroutine names |
60 | that appeared with an C<&> sigil.) |
61 | |
d5114285 |
62 | =head1 Modules and Pragmata |
63 | |
d5114285 |
64 | =head2 New Modules and Pragmata |
65 | |
66 | =over 4 |
67 | |
1fc7262d |
68 | =item C<legacy> |
d5114285 |
69 | |
1fc7262d |
70 | Preserves legacy behaviors or enable new non-default behaviors. |
71 | Currently the only behaviour concerns semantics for the 128 characters |
72 | on ASCII systems that have the 8th bit set. |
d5114285 |
73 | |
74 | =back |
75 | |
76 | =head2 Pragmata Changes |
77 | |
78 | =over 4 |
79 | |
1fc7262d |
80 | =item C<diagnostics> |
d5114285 |
81 | |
1fc7262d |
82 | Supports %.0f formatting internally. |
83 | |
84 | =item C<overload> |
85 | |
86 | Allow overloading of 'qr'. |
d5114285 |
87 | |
88 | =back |
89 | |
90 | =head2 Updated Modules |
91 | |
92 | =over 4 |
93 | |
1fc7262d |
94 | =item C<B::Concise> |
d5114285 |
95 | |
1fc7262d |
96 | =item C<B::Deparse> |
97 | |
98 | =item C<Carp> |
99 | |
100 | =item C<Compress::Zlib> |
101 | |
102 | =item C<CPANPLUS> |
103 | |
104 | =item C<DBM_Filter> |
105 | |
106 | =item C<Encode> |
107 | |
108 | =item C<ExtUtils::CBuilder> |
109 | |
110 | =item C<Env> |
111 | |
112 | =item C<Exporter> |
113 | |
114 | =item C<File::Fetch> |
115 | |
116 | =item C<I8N::Langinfo> |
117 | |
118 | =item C<I8N::LangTags> |
119 | |
120 | =item C<IO::Compress> |
121 | |
122 | =item C<IPC::Cmd> |
123 | |
124 | =item C<List::Util> |
125 | |
126 | =item C<Locale::Maketext> |
127 | |
128 | =item C<Module::Build> |
129 | |
72343ccb |
130 | Updated to 0.35_08. |
131 | |
1fc7262d |
132 | =item C<Module::CoreList> |
133 | |
134 | =item C<Pod::Perldoc> |
135 | |
136 | =item C<Pod::Simple> |
137 | |
138 | =item C<Scalar::Util> |
139 | |
140 | =item C<Switch> |
141 | |
142 | =item C<XS::APItest> |
d5114285 |
143 | |
144 | =back |
145 | |
146 | =head1 Utility Changes |
147 | |
d5114285 |
148 | =over 4 |
149 | |
72343ccb |
150 | =item F<a2p> |
d5114285 |
151 | |
72343ccb |
152 | Fixed bugs with the match() operator in list context, remove mention |
153 | of $[. |
d5114285 |
154 | |
155 | =back |
156 | |
d5114285 |
157 | =head1 Performance Enhancements |
158 | |
d5114285 |
159 | =over 4 |
160 | |
161 | =item * |
162 | |
437d4214 |
163 | Reversing an array to itself (as in C<@a = reverse @a>) in void context now |
164 | happens in-place and is several orders of magnitude faster than it used to be. |
165 | It will also preserve non-existent elements whenever possible, i.e. for non |
166 | magical arrays or tied arrays with C<EXISTS> and C<DELETE> methods. |
d5114285 |
167 | |
168 | =back |
169 | |
d5114285 |
170 | =head1 New or Changed Diagnostics |
171 | |
72343ccb |
172 | Several new diagnostics, see L<perldiag> for details. |
d5114285 |
173 | |
174 | =over 4 |
175 | |
72343ccb |
176 | =item C<Bad plugin affecting keyword '%s'> |
d5114285 |
177 | |
72343ccb |
178 | =item C<gmtime(%.0f) too large> |
179 | |
180 | =item C<Lexing code attempted to stuff non-Latin-1 character into Latin-1 input> |
181 | |
182 | =item C<Lexing code internal error (%s)> |
183 | |
184 | =item C<localtime(%.0f) too large> |
185 | |
186 | =item C<Overloaded dereference did not return a reference> |
187 | |
188 | =item C<Overloaded qr did not return a REGEXP> |
189 | |
190 | =item C<Perl_pmflag() is deprecated, and will be removed from the XS API> |
191 | |
192 | =back |
193 | |
194 | One diagnostic has been removed: |
195 | |
196 | =over 4 |
197 | |
198 | =item C<Runaway format> |
d5114285 |
199 | |
200 | =back |
201 | |
202 | =head1 Changed Internals |
203 | |
d5114285 |
204 | =over 4 |
205 | |
206 | =item * |
207 | |
879d0c72 |
208 | C<Perl_pmflag> has been removed from the public API. Calling it now generates |
209 | a deprecation warning, and it will be removed in a future release. Although |
210 | listed as part of the API, it was never documented, and only ever used in |
211 | F<toke.c>, and prior to 5.10, F<regcomp.c>. In core, it has been replaced by a |
212 | static function. |
d5114285 |
213 | |
214 | =back |
215 | |
216 | =head1 New Tests |
217 | |
d5114285 |
218 | =over 4 |
219 | |
72343ccb |
220 | =item F<t/op/while_readdir.t> |
d5114285 |
221 | |
72343ccb |
222 | Test that a bare readdir in while loop sets $_. |
d5114285 |
223 | |
224 | =back |
225 | |
226 | =head1 Known Problems |
227 | |
d5114285 |
228 | =over 4 |
229 | |
72343ccb |
230 | =item Known test failures on VMS |
d5114285 |
231 | |
72343ccb |
232 | Perl 5.11.2 fails a small set of core and CPAN tests as of this release. |
233 | With luck, that'll be sorted out for 5.11.3. |
d5114285 |
234 | |
235 | =back |
236 | |
237 | =head1 Deprecations |
238 | |
d5114285 |
239 | The following items are now deprecated. |
240 | |
72343ccb |
241 | =head2 Use of C<:=> to mean an empty attribute list is now deprecated. |
d5114285 |
242 | |
72343ccb |
243 | An accident of Perl's parser meant that these constructions were all equivalent: |
d5114285 |
244 | |
72343ccb |
245 | my $pi := 4; |
246 | my $pi : = 4; |
247 | my $pi : = 4; |
d5114285 |
248 | |
72343ccb |
249 | with the C<:> being treated as the start of an attribute list, which ends |
250 | before the C<=>. As whitespace is not significant here, all are parsed as an |
251 | empty attribute list, hence all the above are equivalent to, and better written |
252 | as |
253 | |
254 | my $pi = 4; |
255 | |
256 | because no attribute processing is done for an empty list. |
257 | |
258 | As is, this meant that C<:=> cannot be used as a new token, without silently |
259 | changing the meaning of existing code. Hence that particular form is now |
260 | deprecated, and will become a syntax error. If it is absolutely necessary to |
261 | have empty attribute lists (for example, because of a code generator) then |
262 | avoid the warning by adding a space before the C<=>. |
d5114285 |
263 | |
d5114285 |
264 | =head1 Acknowledgements |
265 | |
72343ccb |
266 | Perl 5.11.2 represents approximately 3 weeks development since Perl 5.11.1 |
267 | contains 29,992 lines of changes across 458 files from 38 authors and committers: |
268 | |
269 | Abhijit Menon-Sen, Abigail, Ben Morrow, Bo Borgerson, Brad Gilbert, Bram, |
270 | Chris Williams, Craig A. Berry, Daniel Frederick Crisman, Dave Rolsky, |
271 | David E. Wheeler, David Golden, Eric Brine, Father Chrysostomos, |
272 | Frank Wiegand, Gerard Goossen, Gisle Aas, Graham Barr, Harmen, H.Merijn Brand, |
273 | Jan Dubois, Jerry D. Hedden, Jesse Vincent, Karl Williamson, Kevin Ryde, |
274 | Leon Brocard, Nicholas Clark, Paul Marquess, Philippe Bruhat, |
275 | Rafael Garcia-Suarez, Sisyphus, Steffen Mueller, Steve Hay, Steve Peters, |
276 | Vincent Pit, Yuval Kogman, Yves Orton, and Zefram. |
d5114285 |
277 | |
72343ccb |
278 | Many of the changes included in this version originated in the CPAN |
279 | modules included in Perl's core. We're grateful to the entire CPAN |
280 | community for helping Perl to flourish. |
d5114285 |
281 | |
282 | =head1 Reporting Bugs |
283 | |
284 | If you find what you think is a bug, you might check the articles |
285 | recently posted to the comp.lang.perl.misc newsgroup and the perl |
72343ccb |
286 | bug database at http://rt.perl.org/perlbug/ . There may also be |
d5114285 |
287 | information at http://www.perl.org/ , the Perl Home Page. |
288 | |
289 | If you believe you have an unreported bug, please run the B<perlbug> |
72343ccb |
290 | program included with your release. Be sure to trim your bug down |
291 | to a tiny but sufficient test case. Your bug report, along with the |
d5114285 |
292 | output of C<perl -V>, will be sent off to perlbug@perl.org to be |
293 | analysed by the Perl porting team. |
294 | |
295 | If the bug you are reporting has security implications, which make it |
296 | inappropriate to send to a publicly archived mailing list, then please send |
297 | it to perl5-security-report@perl.org. This points to a closed subscription |
298 | unarchived mailing list, which includes all the core committers, who be able |
299 | to help assess the impact of issues, figure out a resolution, and help |
300 | co-ordinate the release of patches to mitigate or fix the problem across all |
301 | platforms on which Perl is supported. Please only use this address for |
302 | security issues in the Perl core, not for modules independently |
303 | distributed on CPAN. |
304 | |
305 | =head1 SEE ALSO |
306 | |
307 | The F<Changes> file for an explanation of how to view exhaustive details |
308 | on what changed. |
309 | |
310 | The F<INSTALL> file for how to build Perl. |
311 | |
312 | The F<README> file for general stuff. |
313 | |
314 | The F<Artistic> and F<Copying> files for copyright information. |
315 | |
316 | =cut |