This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Unicode documentation updates
[perl5.git] / pod / perl5113delta.pod
1 =head1 NAME
2
3 perldelta - what is new for perl v5.11.3
4
5 =head1 DESCRIPTION
6
7 This document describes differences between the 5.11.2 release and
8 the 5.11.3 release.
9
10 If you are upgrading from an earlier release such as 5.11.1, first read
11 the L<perl5112delta>, which describes differences between 5.11.1 and
12 5.11.2
13
14 =head1 Incompatible Changes
15
16 =over
17
18 =item Filehandles are blessed directly into C<IO::Handle::>, as C<FileHandle> is merely a wrapper around C<IO::Handle>.
19
20 The previous behaviour was to bless Filehandles into L<FileHandle/>
21 (an empty proxy class) if it was loaded into memory and otherwise
22 to bless them into C<IO::Handle::>.
23
24
25 =back
26
27 =head1 Core Enhancements
28
29 =head2 Unicode version
30
31 Perl is shipped with the latest Unicode version, 5.2, dated October 2009.  See
32 L<http://www.unicode.org/versions/Unicode5.2.0> for details about this release
33 of Unicode.  See L<perlunicode> for instructions on installing and using
34 older versions of Unicode.
35
36 =head2 Unicode properties
37
38 Perl can now handle every Unicode character property.  A new pod,
39 L<perluniprops>, lists all available non-Unihan character properties.  By
40 default the Unihan properties and certain others (deprecated and Unicode
41 internal-only ones) are not exposed.  See below for more details on
42 these; there is also a section in the pod listing them, and why they are
43 not exposed.
44
45 Perl now fully supports the Unicode compound-style of using C<=> and C<:>
46 in writing regular expressions: C<\p{property=value}> and
47 C<\p{property:value}> (both of which mean the same thing).
48
49 Perl now fully supports the Unicode loose matching rules for text
50 between the braces in C<\p{...}> constructs.  In addition, Perl also allows
51 underscores between digits of numbers.
52
53 All the Unicode-defined synonyms for properties and property values are
54 now accepted.
55
56 C<qr/\X/>, which matches a Unicode logical character, has been expanded to work
57 better with various Asian languages.  It now is defined as an C<extended
58 grapheme cluster>.  (See L<http://www.unicode.org/reports/tr29/>).
59 Anything matched by previously will continue to be matched.  But in addition:
60
61 =over
62
63 =item *
64
65 C<\X> will now not break apart a C<S<CR LF>> sequence.
66
67 =item *
68
69 C<\X> will now match a sequence including the C<ZWJ> and C<ZWNJ> characters.
70
71 =item *
72
73 C<\X> will now always match at least one character, including an initial mark.
74 Marks generally come after a base character, but it is possible in Unicode to
75 have them in isolation, and C<\X> will now handle that case, for example at the
76 beginning of a line or after a C<ZWSP>.
77
78 =item *
79
80 C<\X> will now match a (Korean) Hangul syllable sequence, and the Thai and Lao
81 exception cases.
82
83 =back
84
85 Otherwise, this change should be transparent for the non-affected languages.
86
87 C<\p{...}> matches using the Canonical_Combining_Class property were
88 completely broken in previous Perls.  This is now fixed.
89
90 In previous Perls, the Unicode C<Decomposition_Type=Compat> property and a
91 Perl extension had the same name, which led to neither matching all the
92 correct values (with more than 100 mistakes in one, and several thousand
93 in the other).  The Perl extension has now been renamed to be
94 C<Decomposition_Type=Noncanonical> (short: C<dt=noncanon>).  It has the same
95 meaning as was previously intended, namely the union of all the
96 non-canonical Decomposition types, with Unicode C<Compat> being just one of
97 those.
98
99 C<\p{Uppercase}> and C<\p{Lowercase}> have been brought into line with the
100 Unicode definitions.  This means they each match a few more characters
101 than previously.
102
103 C<\p{Cntrl}> now matches the same characters as C<\p{Control}>.  This means it
104 no longer will match Private Use (gc=co), Surrogates (gc=cs), nor Format
105 (gc=cf) code points.  The Format code points represent the biggest
106 possible problem.  All but 36 of them are either officially deprecated
107 or strongly discouraged from being used.  Of those 36, likely the most
108 widely used are the soft hyphen (U+00AD), and BOM, ZWSP, ZWNJ, WJ, and
109 similar, plus Bi-directional controls.
110
111 C<\p{Alpha}> now matches the same characters as C<\p{Alphabetic}>.  The Perl
112 definition included a number of things that aren't really alpha (all
113 marks), while omitting many that were.  As a direct consequence, the
114 definitions of C<\p{Alnum}> and C<\p{Word}> which depend on Alpha also change.
115
116 C<\p{Word}> also now doesn't match certain characters it wasn't supposed
117 to, such as fractions.
118
119 C<\p{Print}> no longer matches the line control characters: Tab, LF, CR,
120 FF, VT, and NEL.  This brings it in line with the documentation.
121
122 C<\p{Decomposition_Type=Canonical}> now includes the Hangul syllables.
123
124 The Numeric type property has been extended to include the Unihan
125 characters.
126
127 There is a new Perl extension, the 'Present_In', or simply 'In',
128 property.  This is an extension of the Unicode Age property, but
129 C<\p{In=5.0}> matches any code point whose usage has been determined
130 I<as of> Unicode version 5.0.  The C<\p{Age=5.0}> only matches code points
131 added in I<precisely> version 5.0.
132
133 A number of properties did not have the correct values for unassigned
134 code points.  This is now fixed.  The affected properties are
135 Bidi_Class, East_Asian_Width, Joining_Type, Decomposition_Type,
136 Hangul_Syllable_Type, Numeric_Type, and Line_Break.
137
138 The Default_Ignorable_Code_Point, ID_Continue, and ID_Start properties
139 have been updated to their current Unicode definitions.
140
141 Certain properties that are supposed to be Unicode internal-only were
142 erroneously exposed by previous Perls.  Use of these in regular
143 expressions will now generate, if enabled, a deprecated warning message.
144 The properties are: Other_Alphabetic, Other_Default_Ignorable_Code_Point,
145 Other_Grapheme_Extend, Other_ID_Continue, Other_ID_Start, Other_Lowercase,
146 Other_Math, and Other_Uppercase.
147
148 An installation can now fairly easily change which Unicode properties
149 Perl understands.  As mentioned above, certain properties are by default
150 turned off.  These include all the Unihan properties (which should be
151 accessible via the CPAN module Unicode::Unihan) and any deprecated or
152 Unicode internal-only property that Perl has never exposed.
153
154 XXX what does "files in the To directory" mean? -- dagolden, 2009-12-20
155
156 The files in the C<lib/unicore/To> directory are now more clearly marked as
157 being stable, directly usable by applications.  New hash entries in them give
158 the format of the normal entries, which allows for easier machine parsing.
159 Perl can generate files in this directory for any property, though most are
160 suppressed.  An installation can choose to change which get written.
161 Instructions are in L<perluniprops>.
162
163 =head1 Modules and Pragmata
164
165 =head2 Pragmata Changes
166
167 =over 4
168
169 =item C<constant>
170
171 Upgraded from version 1.19 to 1.20.
172
173 =item C<diagnostics>
174
175 This pragma no longer suppresses C<Use of uninitialized value in range (or flip)> warnings. [perl #71204]
176
177 =item C<feature>
178
179 Upgraded from 1.13 to 1.14.  Added the C<unicode_strings> feature:
180
181     use feature "unicode_strings";
182
183 This pragma turns on Unicode semantics for the case-changing operations
184 (uc/lc/ucfirst/lcfirst) on strings that don't have the internal UTF-8 flag set,
185 but that contain single-byte characters between 128 and 255.
186
187 =item C<legacy>
188
189 The experimental C<legacy> pragma, introduced in 5.11.2, has been removed,
190 and its functionality replaced by the new feature pragma, C<use feature
191 "unicode_strings">.
192
193 =item C<threads>
194
195 Upgraded from version 1.74 to 1.75.
196
197 =item C<warnings>
198
199 Upgraded from 1.07 to 1.08.  Added new C<warnings::fatal_enabled()> function.
200
201 =back
202
203 =head2 Updated Modules
204
205 =over 4
206
207 =item C<Archive::Extract>
208
209 Upgraded from version 0.34 to 0.36.
210
211 =item C<CPAN>
212
213 Upgraded from version 1.94_51 to 1.94_53.  Includes better bzip2 support,
214 improved FirstTime experience with auto-selection of CPAN mirrors, proper
215 handling of modules removed from the Perl core, and an updated 'cpan'
216 utility script
217
218 =item C<CPANPLUS>
219
220 Upgraded from version 0.89_09 to 0.90.
221
222 =item C<ExtUtils::MakeMaker>
223
224 Upgraded from version 6.55_02 to 6.56.  Adds new BUILD_REQUIRES key to
225 indicate build-only prerequisites.  Also adds support for
226 mingw64 and the new "package NAME VERSION" syntax.
227
228 =item C<File::Path>
229
230 Upgraded from version 2.08 to 2.08_01.
231
232 =item C<Module::Build>
233
234 Upgraded from version 0.35_09 to 0.36.  Compared to 0.35, this version has a
235 new 'installdeps' action, supports the PERL_MB_OPT environment variable, adds a
236 'share_dir' property for L<File::ShareDir> support, support the "package NAME
237 VERSION" syntax and has many other enhancements and bug fixes.  The
238 'passthrough' style of Module::Build::Compat has been deprecated.
239
240 =item C<Module::CoreList>
241
242 Upgraded from version 2.23 to 2.24.
243
244 =item C<POSIX>
245
246 Upgraded from version 1.18 to 1.19. Error codes for C<getaddrinfo()> and C<getnameinfo()> are now
247 available.
248
249 =item C<Pod::Simple>
250
251 Upgraded from version 3.10 to 3.13.
252
253 =item C<Safe>
254
255 Upgraded from version 2.19 to 2.20.
256
257 =back
258
259 =head1 Utility Changes
260
261 =over 4
262
263 =item F<perlbug>
264
265 No longer reports "Message sent" when it hasn't actually sent the message
266
267 =back
268
269 =head1 Changes to Existing Documentation
270
271 The Pod specification (L<perlpodspec>) has been updated to bring the
272 specification in line with modern usage already supported by most Pod systems.
273 A parameter string may now follow the format name in a "begin/end" region.
274 Links to URIs with a text description are now allowed.  The usage of
275 C<LE<lt>"section"E<gt>> has been marked as deprecated.
276
277 L<if.pm|if> has been documented in L<perlfunc/use> as a means to get
278 conditional loading of modules despite the implicit BEGIN block around C<use>.
279
280
281
282 =head1 Installation and Configuration Improvements
283
284 XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools
285 go here.
286
287 =head2 Configuration improvements
288
289 XXX
290
291 =head2 Compilation improvements
292
293     Make distclean work again
294 XXX
295
296 =head2 Testing improvements
297
298 =over 4
299
300 =item It's now possible to override C<PERL5OPT> and friends in F<t/TEST>
301
302 =back
303
304 =head2 Platform Specific Changes
305
306 =over 4
307
308 =item Win32
309
310 =over 4
311
312 =item *
313
314 Always add a manifest resource to C<perl.exe> to specify the <trustInfo>
315 settings for Windows Vista and later.  Without this setting Windows
316 will treat C<perl.exe> as a legacy application and apply various
317 heuristics like redirecting access to protected file system areas
318 (like the "Program Files" folder) to the users "VirtualStore"
319 instead of generating a proper "permission denied" error.
320
321 For VC8 and VC9 this manifest setting is automatically generated by
322 the compiler/linker (together with the binding information for their
323 respective runtime libraries); for all other compilers we need to
324 embed the manifest resource explicitly in the external resource file.
325
326 This change also requests the Microsoft Common-Controls version 6.0
327 (themed controls introduced in Windows XP) via the dependency list
328 in the assembly manifest.  For VC8 and VC9 this is specified using the
329 C</manifestdependency> linker commandline option instead.
330
331 =back
332
333 =item cygwin
334
335 =over 4
336
337 =item Enable IPv6 support on cygwin 1.7 and newer
338
339 =back
340
341 =item OpenVMS
342
343 =over 4
344
345 =item Make -UDEBUGGING the default on VMS for 5.12.0.
346
347 Like it has been everywhere else for ages and ages.  Also make
348 command-line selection of -UDEBUGGING and -DDEBUGGING work in
349 configure.com; before the only way to turn it off was by saying
350 no in answer to the interactive question.
351
352 =back
353
354 =back
355
356 =head1 Selected Bug Fixes
357
358 XXX Important bug fixes in the core language are summarised here.
359 Bug fixes in files in F<ext/> and F<lib/> are best summarised in
360 L</Modules and Pragmata>.
361
362 =over 4
363
364 =item *
365
366 Ensure that pp_qr returns a new regexp SV each time. Resolves RT #69852.
367
368 Instead of returning a(nother) reference to the (pre-compiled) regexp in the
369 optree, use reg_temp_copy() to create a copy of it, and return a reference to
370 that. This resolves issues about Regexp::DESTROY not being called in a timely
371 fashion (the original bug tracked by RT #69852), as well as bugs related to
372 blessing regexps, and of assigning to regexps, as described in correspondence
373 added to the ticket.
374
375 It transpires that we also need to undo the SvPVX() sharing when ithreads
376 cloning a Regexp SV, because mother_re is set to NULL, instead of a cloned
377 copy of the mother_re. This change might fix bugs with regexps and threads in
378 certain other situations, but as yet neither tests nor bug reports have
379 indicated any problems, so it might not actually be an edge case that it's
380 possible to reach.
381
382 =item  *
383
384 Several compilation errors and segfaults when perl was built with C<-Dmad> were fixed.
385
386 =item *
387
388 Fixes for lexer API changes in 5.11.2 which broke NYTProf's savesrc option.
389
390 =item *
391
392 F<-t> should only return TRUE for file handles connected to a TTY
393
394 The Microsoft C version of isatty() returns TRUE for all
395 character mode devices, including the /dev/null style "nul"
396 device and printers like "lpt1".
397
398 =item *
399
400 Fixed a regression caused by commit fafafbaf which caused a panic during parameter passing [perl #70171]
401
402
403 =item *
404
405 On systems which in-place edits without backup files, -i'*' now works as the documentation says it does [perl #70802]
406
407 =item *
408
409 Saving and restoring magic flags no longer loses readonly flag.
410
411 =item *
412
413 The malformed syntax C<grep EXPR LIST> (note the missing comma) no longer
414 causes abrupt and total failure.
415
416 =item *
417
418 Regular expressions compiled with C<qr{}> literals properly set C<$'> when
419 matching again.
420
421 =item *
422
423 Using named subroutines with C<sort> should no longer lead to bus errors [perl
424 #71076]
425
426 =item *
427
428 Numerous bugfixes catch small issues caused by the recently-added Lexer API.
429
430 =item *
431
432 Smart match against C<@_> sometimes gave false negatives negatives. [perl #71078]
433
434 =item *
435
436 C<$@> may now be assigned a read-only value (without error or busting the stack).
437
438 =back
439
440 =head1 New or Changed Diagnostics
441
442 =over 4
443
444 =item *
445
446 C<split> now warns when called in void context
447
448
449 =item *
450
451 C<printf>-style functions called with too few arguments will now issue the warning C<"Missing argument in %s"> [perl #71000] 
452
453
454 =back
455
456 =head1 New Tests
457
458 Many modules updated from CPAN incorporate new tests.
459
460 =over 4
461
462 =item t/comp/final_line_num.t
463
464 See if line numbers are correct at EOF
465
466 =item t/comp/form_scope.t
467
468 See if format scoping works
469
470 =item t/comp/line_debug.t
471
472 See if @{"_<$file"} works
473
474 =item t/op/filetest_t.t
475
476 See if -t file test works
477
478 =item t/op/qr.t
479
480 See if qr works
481
482 =item t/op/utf8cache.t
483
484 Tests malfunctions of utf8 cache
485
486 =item t/re/uniprops.t
487
488 Test unicode \p{} regex constructs
489
490 =back
491
492 =head1 Deprecations
493
494 The following items are now deprecated.
495
496 =over 4
497
498 =item Use of "goto" to jump into a construct is deprecated
499
500 Using C<goto> to jump from an outer scope into an inner
501 scope is now deprecated. This rare use case was causing
502 problems in the implementation of scopes.
503
504 =back
505
506 =head1 Acknowledgements
507
508 XXX The list of people to thank goes here.
509
510
511 =head1 Reporting Bugs
512
513 If you find what you think is a bug, you might check the articles
514 recently posted to the comp.lang.perl.misc newsgroup and the perl
515 bug database at http://rt.perl.org/perlbug/ .  There may also be
516 information at http://www.perl.org/ , the Perl Home Page.
517
518 If you believe you have an unreported bug, please run the B<perlbug>
519 program included with your release.  Be sure to trim your bug down
520 to a tiny but sufficient test case.  Your bug report, along with the
521 output of C<perl -V>, will be sent off to perlbug@perl.org to be
522 analysed by the Perl porting team.
523
524 If the bug you are reporting has security implications, which make it
525 inappropriate to send to a publicly archived mailing list, then please send
526 it to perl5-security-report@perl.org. This points to a closed subscription
527 unarchived mailing list, which includes all the core committers, who be able
528 to help assess the impact of issues, figure out a resolution, and help
529 co-ordinate the release of patches to mitigate or fix the problem across all
530 platforms on which Perl is supported. Please only use this address for
531 security issues in the Perl core, not for modules independently
532 distributed on CPAN.
533
534 =head1 SEE ALSO
535
536 The F<Changes> file for an explanation of how to view exhaustive details
537 on what changed.
538
539 The F<INSTALL> file for how to build Perl.
540
541 The F<README> file for general stuff.
542
543 The F<Artistic> and F<Copying> files for copyright information.
544
545 =cut
546
547
548
549
550 All changes through commit b4178430270dbe109e7609d0b50d6d54bf9e95d8
551 One "triage" pass done.
552
553 A second triage pass is still needed to remove unimportant changes
554
555 commit 9307c420fad2f6f5bd314f9ed66dd53288703e09
556 Author: Jan Dubois <jand@activestate.com>
557 Date:   Thu Dec 17 18:28:16 2009 -0800
558
559     Export PL_curinterp symbol for MULTIPLICITY without USE_ITHREADS
560
561     This is necessary for XS extensions that define PERL_CORE.  In that
562     situation PERL_GET_CONTEXT will resolve to PL_curinterp, which is
563     normally not exported (extensions call Perl_Gcurinterp_ptr() to get a
564     pointer to PL_curinterp instead). With USE_ITHREADS defined
565     PERL_GET_CONTEXT will expand to Perl_get_context() even inside the
566     core because the context needs to be fetched from threadlocal storage.
567
568 commit 8a27a13e89107aaf68c0748b68ee71fbd86d774b
569
570     [perl #71076] sort with active sub (5.10 regression)
571
572     One of the tests in sort.t causes a bus error (or sometimes Ã¢\80\98Undefined
573     subroutine calledâ\80\99) if run multiple times. This is because sort
574     decreases the refcount of an active sub used as a comparison routine.
575
576 commit 576b33a19ccaf98d4dfe201d529c55c3747f0cb6
577
578     [rt.cpan.org #51574] Safe.pm sort {} bug accessing $a and $b with -Dusethreads
579
580 commit ee6ba15dedda3e88eb66891eaf387c00a4c0a2fb
581
582     Fix -DPERL_NO_UTF16_FILTER