1PERL5110DELTA(1)       Perl Programmers Reference Guide       PERL5110DELTA(1)
2
3
4

NAME

6       perl5110delta - what is new for perl v5.11.0
7

DESCRIPTION

9       This document describes differences between the 5.10.0 release and the
10       5.11.0 development release.
11

Incompatible Changes

13   Unicode interpretation of \w, \d, \s, and the POSIX character classes
14       redefined.
15       Previous versions of Perl tried to map POSIX style character class
16       definitions onto Unicode property names so that patterns would "dwim"
17       when matches were made against latin-1 or unicode strings. This proved
18       to be a mistake, breaking character class negation, causing forward
19       compatibility problems (as Unicode keeps updating their property
20       definitions and adding new characters), and other problems.
21
22       Therefore we have now defined a new set of artificial "unicode"
23       property names which will be used to do unicode matching of patterns
24       using POSIX style character classes and perl short-form escape
25       character classes like \w and \d.
26
27       The key change here is that \d will no longer match every digit in the
28       unicode standard (there are thousands) nor will \w match every word
29       character in the standard, instead they will match precisely their
30       POSIX or Perl definition.
31
32       Those needing to match based on Unicode properties can continue to do
33       so by using the \p{} syntax to match whichever property they like,
34       including the new artificial definitions.
35
36       NOTE: This is a backwards incompatible no-warning change in behaviour.
37       If you are upgrading and you process large volumes of text look for
38       POSIX and Perl style character classes and change them to the relevent
39       property name (by removing the word 'Posix' from the current name).
40
41       The following table maps the POSIX character class names, the escapes
42       and the old and new Unicode property mappings:
43
44           POSIX  Esc  Class               New-Property  ! Old-Property
45           ----------------------------------------------+-------------
46           alnum       [0-9A-Za-z]         IsPosixAlnum  ! IsAlnum
47           alpha       [A-Za-z]            IsPosixAlpha  ! IsAlpha
48           ascii       [\000-\177]         IsASCII       = IsASCII
49           blank       [\011 ]             IsPosixBlank  !
50           cntrl       [\0-\37\177]        IsPosixCntrl  ! IsCntrl
51           digit   \d  [0-9]               IsPosixDigit  ! IsDigit
52           graph       [!-~]               IsPosixGraph  ! IsGraph
53           lower       [a-z]               IsPosixLower  ! IsLower
54           print       [ -~]               IsPosixPrint  ! IsPrint
55           punct       [!-/:-@[-`{-~]      IsPosixPunct  ! IsPunct
56           space       [\11-\15 ]          IsPosixSpace  ! IsSpace
57                   \s  [\11\12\14\15 ]     IsPerlSpace   ! IsSpacePerl
58           upper       [A-Z]               IsPosixUpper  ! IsUpper
59           word    \w  [0-9A-Z_a-z]        IsPerlWord    ! IsWord
60           xdigit      [0-9A-Fa-f]         IsXDigit      = IsXDigit
61
62       If you wish to build perl with the old mapping you may do so by setting
63
64               #define PERL_LEGACY_UNICODE_CHARCLASS_MAPPINGS 1
65
66       in regcomp.h, and then setting
67
68               PERL_TEST_LEGACY_POSIX_CC
69
70       to true your enviornment when testing.
71
72   @INC reorganization
73       In @INC, ARCHLIB and PRIVLIB now occur after after the current
74       version's site_perl and vendor_perl.
75
76   Switch statement changes
77       The handling of complex expressions by the "given"/"when" switch
78       statement has been enhanced. These enhancements are also available in
79       5.10.1 and subsequent 5.10 releases. There are two new cases where
80       "when" now interprets its argument as a boolean, instead of an
81       expression to be used in a smart match:
82
83       flip-flop operators
84           The ".." and "..." flip-flop operators are now evaluated in boolean
85           context, following their usual semantics; see "Range Operators" in
86           perlop.
87
88           Note that, as in perl 5.10.0, "when (1..10)" will not work to test
89           whether a given value is an integer between 1 and 10; you should
90           use "when ([1..10])" instead (note the array reference).
91
92           However, contrary to 5.10.0, evaluating the flip-flop operators in
93           boolean context ensures it can now be useful in a "when()", notably
94           for implementing bistable conditions, like in:
95
96               when (/^=begin/ .. /^=end/) {
97                 # do something
98               }
99
100       defined-or operator
101           A compound expression involving the defined-or operator, as in
102           "when (expr1 // expr2)", will be treated as boolean if the first
103           expression is boolean. (This just extends the existing rule that
104           applies to the regular or operator, as in "when (expr1 || expr2)".)
105
106       The next section details more changes brought to the semantics to the
107       smart match operator, that naturally also modify the behaviour of the
108       switch statements where smart matching is implicitly used.  These
109       changers were also made for the 5.10.1 release, and will remain in
110       subsequent 5.10 releases.
111
112   Smart match changes
113       Changes to type-based dispatch
114
115       The smart match operator "~~" is no longer commutative. The behaviour
116       of a smart match now depends primarily on the type of its right hand
117       argument. Moreover, its semantics have been adjusted for greater
118       consistency or usefulness in several cases. While the general backwards
119       compatibility is maintained, several changes must be noted:
120
121       ·   Code references with an empty prototype are no longer treated
122           specially.  They are passed an argument like the other code
123           references (even if they choose to ignore it).
124
125       ·   "%hash ~~ sub {}" and "@array ~~ sub {}" now test that the
126           subroutine returns a true value for each key of the hash (or
127           element of the array), instead of passing the whole hash or array
128           as a reference to the subroutine.
129
130       ·   Due to the commutativity breakage, code references are no longer
131           treated specially when appearing on the left of the "~~" operator,
132           but like any vulgar scalar.
133
134       ·   "undef ~~ %hash" is always false (since "undef" can't be a key in a
135           hash). No implicit conversion to "" is done (as was the case in
136           perl 5.10.0).
137
138       ·   "$scalar ~~ @array" now always distributes the smart match across
139           the elements of the array. It's true if one element in @array
140           verifies "$scalar ~~ $element". This is a generalization of the old
141           behaviour that tested whether the array contained the scalar.
142
143       The full dispatch table for the smart match operator is given in "Smart
144       matching in detail" in perlsyn.
145
146       Smart match and overloading
147
148       According to the rule of dispatch based on the rightmost argument type,
149       when an object overloading "~~" appears on the right side of the
150       operator, the overload routine will always be called (with a 3rd
151       argument set to a true value, see overload.) However, when the object
152       will appear on the left, the overload routine will be called only when
153       the rightmost argument is a simple scalar. This way distributivity of
154       smart match across arrays is not broken, as well as the other
155       behaviours with complex types (coderefs, hashes, regexes). Thus,
156       writers of overloading routines for smart match mostly need to worry
157       only with comparing against a scalar, and possibly with stringification
158       overloading; the other common cases will be automatically handled
159       consistently.
160
161       "~~" will now refuse to work on objects that do not overload it (in
162       order to avoid relying on the object's underlying structure). (However,
163       if the object overloads the stringification or the numification
164       operators, and if overload fallback is active, it will be used instead,
165       as usual.)
166
167   Labels can't be keywords
168       Labels used as targets for the "goto", "last", "next" or "redo"
169       statements cannot be keywords anymore. This restriction will prevent
170       potential confusion between the "goto LABEL" and "goto EXPR" syntaxes:
171       for example, a statement like "goto print" would jump to a label whose
172       name would be the return value of "print()", (usually 1), instead of a
173       label named "print". Moreover, the other control flow statements would
174       just ignore any keyword passed to them as a label name. Since such
175       labels cannot be defined anymore, this kind of error will be avoided.
176
177   Other incompatible changes
178       ·   The semantics of "use feature :5.10*" have changed slightly.  See
179           "Modules and Pragmata" for more information.
180
181       ·   It is now a run-time error to use the smart match operator "~~"
182           with an object that has no overload defined for it. (This way "~~"
183           will not break encapsulation by matching against the object's
184           internal representation as a reference.)
185
186       ·   The version control system used for the development of the perl
187           interpreter has been switched from Perforce to git.  This is mainly
188           an internal issue that only affects people actively working on the
189           perl core; but it may have minor external visibility, for example
190           in some of details of the output of "perl -V". See perlrepository
191           for more information.
192
193       ·   The internal structure of the "ext/" directory in the perl source
194           has been reorganised. In general, a module "Foo::Bar" whose source
195           was stored under ext/Foo/Bar/ is now located under ext/Foo-Bar/.
196           Also, nearly all dual-life modules have been moved from lib/ to
197           ext/. This is purely a source tarball change, and should make no
198           difference to the compilation or installation of perl, unless you
199           have a very customised build process that explicitly relies on this
200           structure, or which hard-codes the "nonxs_ext" Configure parameter.
201           Specifically, this change does not by default alter the location of
202           any files in the final installation.
203
204       ·   As part of the "Test::Harness" 2.x to 3.x upgrade, the experimental
205           "Test::Harness::Straps" module has been removed.  See "Updated
206           Modules" for more details.
207
208       ·   As part of the "ExtUtils::MakeMaker" upgrade, the
209           "ExtUtils::MakeMaker::bytes" and "ExtUtils::MakeMaker::vmsish"
210           modules have been removed from this distribution.
211
212       ·   "Module::CoreList" no longer contains the %:patchlevel hash.
213
214       ·   This one is actually a change introduced in 5.10.0, but it was
215           missed from that release's perldelta, so it is mentioned here
216           instead.
217
218           A bugfix related to the handling of the "/m" modifier and "qr"
219           resulted in a change of behaviour between 5.8.x and 5.10.0:
220
221               # matches in 5.8.x, doesn't match in 5.10.0
222               $re = qr/^bar/; "foo\nbar" =~ /$re/m;
223
224       ·   "length undef" now returns undef.
225
226       ·   Unsupported private C API functions are now declared "static" to
227           prevent leakage to Perl's public API.
228
229       ·   To support the bootstrapping process, miniperl no longer builds
230           with UTF-8 support in the regexp engine.
231
232           This allows a build to complete with PERL_UNICODE set and a UTF-8
233           locale.  Without this there's a bootstrapping problem, as miniperl
234           can't load the UTF-8 components of the regexp engine, because
235           they're not yet built.
236
237       ·   miniperl's @INC is now restricted to just -I..., the split of
238           $ENV{PERL5LIB}, and "."
239
240       ·   A space or a newline is now required after a "#line XXX" directive.
241
242       ·   Tied filehandles now have an additional method EOF which provides
243           the EOF type
244
245       ·   To better match all other flow control statements, "foreach" may no
246           longer be used as an attribute.
247

Core Enhancements

249   Unicode Character Database 5.1.0
250       The copy of the Unicode Character Database included in Perl 5.11.0 has
251       been updated to 5.1.0 from 5.0.0. See
252       <http://www.unicode.org/versions/Unicode5.1.0/#Notable_Changes> for the
253       notable changes.
254
255   A proper interface for pluggable Method Resolution Orders
256       As of Perl 5.11.0 there is a new interface for plugging and using
257       method resolution orders other than the default (linear depth first
258       search).  The C3 method resolution order added in 5.10.0 has been re-
259       implemented as a plugin, without changing its Perl-space interface. See
260       perlmroapi for more information.
261
262   The "overloading" pragma
263       This pragma allows you to lexically disable or enable overloading for
264       some or all operations. (Yuval Kogman)
265
266   "\N" regex escape
267       A new regex escape has been added, "\N". It will match any character
268       that is not a newline, independently from the presence or absence of
269       the single line match modifier "/s". (If "\N" is followed by an opening
270       brace and by a letter, perl will still assume that a Unicode character
271       name is coming, so compatibility is preserved.) (Rafael Garcia-Suarez)
272
273   Implicit strictures
274       Using the "use VERSION" syntax with a version number greater or equal
275       to 5.11.0 will also lexically enable strictures just like "use strict"
276       would do (in addition to enabling features.) So, the following:
277
278           use 5.11.0;
279
280       will now imply:
281
282           use strict;
283           use feature ':5.11';
284
285   Parallel tests
286       The core distribution can now run its regression tests in parallel on
287       Unix-like platforms. Instead of running "make test", set "TEST_JOBS" in
288       your environment to the number of tests to run in parallel, and run
289       "make test_harness". On a Bourne-like shell, this can be done as
290
291           TEST_JOBS=3 make test_harness  # Run 3 tests in parallel
292
293       An environment variable is used, rather than parallel make itself,
294       because TAP::Harness needs to be able to schedule individual non-
295       conflicting test scripts itself, and there is no standard interface to
296       "make" utilities to interact with their job schedulers.
297
298       Note that currently some test scripts may fail when run in parallel
299       (most notably "ext/IO/t/io_dir.t"). If necessary run just the failing
300       scripts again sequentially and see if the failures go away.
301
302   The "..." operator
303       A new operator, "...", nicknamed the Yada Yada operator, has been
304       added.  It is intended to mark placeholder code, that is not yet
305       implemented.  See "Yada Yada Operator" in perlop. (chromatic)
306
307   DTrace support
308       Some support for DTrace has been added. See "DTrace support" in
309       INSTALL.
310
311   Support for "configure_requires" in CPAN module metadata
312       Both "CPAN" and "CPANPLUS" now support the "configure_requires" keyword
313       in the META.yml metadata file included in most recent CPAN
314       distributions.  This allows distribution authors to specify
315       configuration prerequisites that must be installed before running
316       Makefile.PL or Build.PL.
317
318       See the documentation for "ExtUtils::MakeMaker" or "Module::Build" for
319       more on how to specify "configure_requires" when creating a
320       distribution for CPAN.
321
322   "each" is now more flexible
323       The "each" function can now operate on arrays.
324
325   Y2038 compliance
326       Perl's core time-related functions are now Y2038 compliant. (With 29
327       years to spare!)
328
329   $, flexibility
330       The variable $, may now be tied.
331
332   // in where clauses
333       // now behaves like || in when clauses
334
335   Enabling warnings from your shell environment
336       You can now set "-W" from the "PERL5OPT" environment variable
337
338   "delete local"
339       "delete local" now allows you to locally delete a hash entry.
340
341   New support for Abstract namespace sockets
342       Abstract namespace sockets are Linux-specific socket type that live in
343       AF_UNIX family, slightly abusing it to be able to use arbitrary
344       character arrays as addresses: They start with nul byte and are not
345       terminated by nul byte, but with the length passed to the socket()
346       system call.
347

Modules and Pragmata

349   Dual-lifed modules moved
350       Dual-lifed modules maintained primarily in the Perl core now live in
351       dist/.  Dual-lifed modules maintained primarily on CPAN now live in
352       cpan/
353
354       In previous releases of Perl, it was customary to enumerate all module
355       changes in this section of the "perldelta" file.   From 5.11.0 forward
356       only notable updates (such as new or deprecated modules ) will be
357       listed in this section. For a complete reference to the versions of
358       modules shipped in a given release of perl, please see
359       Module::CoreList.
360
361   New Modules and Pragmata
362       "autodie"
363           This is a new lexically-scoped alternative for the "Fatal" module.
364           The bundled version is 2.06_01. Note that in this release, using a
365           string eval when "autodie" is in effect can cause the autodie
366           behaviour to leak into the surrounding scope. See "BUGS" in autodie
367           for more details.
368
369       "Compress::Raw::Bzip2"
370           This has been added to the core (version 2.020).
371
372       "parent"
373           This pragma establishes an ISA relationship with base classes at
374           compile time. It provides the key feature of "base" without the
375           feature creep.
376
377       "Parse::CPAN::Meta"
378           This has been added to the core (version 1.39).
379
380   Pragmata Changes
381       "overloading"
382           See "The "overloading" pragma" above.
383
384       "attrs"
385           The "attrs" pragma has been removed. It had been marked as
386           deprecated since 5.6.0.
387
388       "charnames"
389           The Unicode NameAliases.txt database file has been added. This has
390           the effect of adding some extra "\N" character names that formerly
391           wouldn't have been recognised; for example, "\N{LATIN CAPITAL
392           LETTER GHA}".
393
394       "feature"
395           The meaning of the ":5.10" and ":5.10.X" feature bundles has
396           changed slightly. The last component, if any (i.e. "X") is simply
397           ignored.  This is predicated on the assumption that new features
398           will not, in general, be added to maintenance releases. So ":5.10"
399           and ":5.10.X" have identical effect. This is a change to the
400           behaviour documented for 5.10.0.
401
402       "mro"
403           Upgraded from version 1.00 to 1.01. Performance for single
404           inheritance is 40% faster - see "Performance Enhancements" below.
405
406           "mro" is now implemented as an XS extension. The documented
407           interface has not changed. Code relying on the implementation
408           detail that some "mro::" methods happened to be available at all
409           times gets to "keep both pieces".
410
411   Updated Modules
412       "ExtUtils::MakeMaker"
413           Upgraded from version 6.42 to 6.55_02.
414
415           Note that "ExtUtils::MakeMaker::bytes" and
416           "ExtUtils::MakeMaker::vmsish" have been removed from this
417           distribution.
418
419       "Test::Harness"
420           Upgraded from version 2.64 to 3.17.
421
422           Note that one side-effect of the 2.x to 3.x upgrade is that the
423           experimental "Test::Harness::Straps" module (and its supporting
424           "Assert", "Iterator", "Point" and "Results" modules) have been
425           removed. If you still need this, then they are available in the
426           (unmaintained) "Test-Harness-Straps" distribution on CPAN.
427
428       "UNIVERSAL"
429           Upgraded from version 1.04 to 1.05.
430
431           "UNIVERSAL->import()" is now deprecated.
432

Utility Changes

434       h2ph
435           Now looks in "include-fixed" too, which is a recent addition to
436           gcc's search path.
437
438       h2xs
439           No longer incorrectly treats enum values like macros (Daniel Burr).
440
441           Now handles C++ style constants ("//") properly in enums. (A patch
442           from Rainer Weikusat was used; Daniel Burr also proposed a similar
443           fix).
444
445       perl5db.pl
446           "LVALUE" subroutines now work under the debugger.
447
448           The debugger now correctly handles proxy constant subroutines, and
449           subroutine stubs.
450
451       perlbug
452           perlbug now uses %Module::CoreList::bug_tracker to print out
453           upstream bug tracker URLs.
454
455           Where the user names a module that their bug report is about, and
456           we know the URL for its upstream bug tracker, provide a message to
457           the user explaining that the core copies the CPAN version directly,
458           and provide the URL for reporting the bug directly to upstream.
459
460       perlthanks
461           Perl 5.11.0 added a new utility perlthanks, which is a variant of
462           perlbug, but for sending non-bug-reports to the authors and
463           maintainers of Perl. Getting nothing but bug reports can become a
464           bit demoralising: we'll see if this changes things.
465

New Documentation

467       perlhaiku
468           This contains instructions on how to build perl for the Haiku
469           platform.
470
471       perlmroapi
472           This describes the new interface for pluggable Method Resolution
473           Orders.
474
475       perlperf
476           This document, by Richard Foley, provides an introduction to the
477           use of performance and optimization techniques which can be used
478           with particular reference to perl programs.
479
480       perlrepository
481           This describes how to access the perl source using the git version
482           control system.
483

Changes to Existing Documentation

485       The various large Changes* files (which listed every change made to
486       perl over the last 18 years) have been removed, and replaced by a small
487       file, also called Changes, which just explains how that same
488       information may be extracted from the git version control system.
489
490       The file Porting/patching.pod has been deleted, as it mainly described
491       interacting with the old Perforce-based repository, which is now
492       obsolete.  Information still relevant has been moved to perlrepository.
493
494       perlapi, perlintern, perlmodlib and perltoc are now all generated at
495       build time, rather than being shipped as part of the release.
496
497       ·   Documented -X overloading.
498
499       ·   Documented that "when()" treats specially most of the filetest
500           operators
501
502       ·   Documented when as a syntax modifier
503
504       ·   Eliminated "Old Perl threads tutorial", which describes 5005
505           threads.
506
507           pod/perlthrtut.pod is the same material reworked for ithreads.
508
509       ·   Correct previous documentation: v-strings are not deprecated
510
511           With version objects, we need them to use MODULE VERSION syntax.
512           This patch removes the deprecation note.
513
514       ·   Added security contact information to perlsec
515

Performance Enhancements

517       ·   A new internal cache means that "isa()" will often be faster.
518
519       ·   The implementation of "C3" Method Resolution Order has been
520           optimised - linearisation for classes with single inheritance is
521           40% faster. Performance for multiple inheritance is unchanged.
522
523       ·   Under "use locale", the locale-relevant information is now cached
524           on read-only values, such as the list returned by "keys %hash".
525           This makes operations such as "sort keys %hash" in the scope of
526           "use locale" much faster.
527
528       ·   Empty "DESTROY" methods are no longer called.
529
530       ·   Faster "Perl_sv_utf8_upgrade()"
531
532       ·   Speed up "keys" on empty hash
533

Installation and Configuration Improvements

535   ext/ reorganisation
536       The layout of directories in ext has been revised. Specifically, all
537       extensions are now flat, and at the top level, with "/" in pathnames
538       replaced by "-", so that ext/Data/Dumper/ is now ext/Data-Dumper/, etc.
539       The names of the extensions as specified to Configure, and as reported
540       by %Config::Config under the keys "dynamic_ext", "known_extensions",
541       "nonxs_ext" and "static_ext" have not changed, and still use "/". Hence
542       this change will not have any affect once perl is installed. "Safe" has
543       been split out from being part of "Opcode", and "mro" is now an
544       extension in its own right.
545
546       Nearly all dual-life modules have been moved from lib to ext, and will
547       now appear as known "nonxs_ext". This will made no difference to the
548       structure of an installed perl, nor will the modules installed differ,
549       unless you run Configure with options to specify an exact list of
550       extensions to build. In this case, you will rapidly become aware that
551       you need to add to your list, because various modules needed to
552       complete the build, such as "ExtUtils::ParseXS", have now become
553       extensions, and without them the build will fail well before it
554       attempts to run the regression tests.
555
556   Configuration improvements
557       If "vendorlib" and "vendorarch" are the same, then they are only added
558       to @INC once.
559
560       $Config{usedevel} and the C-level "PERL_USE_DEVEL" are now defined if
561       perl is built with  "-Dusedevel".
562
563       Configure will enable use of "-fstack-protector", to provide protection
564       against stack-smashing attacks, if the compiler supports it.
565
566       Configure will now determine the correct prototypes for re-entrant
567       functions, and for "gconvert", if you are using a C++ compiler rather
568       than a C compiler.
569
570       On Unix, if you build from a tree containing a git repository, the
571       configuration process will note the commit hash you have checked out,
572       for display in the output of "perl -v" and "perl -V". Unpushed local
573       commits are automatically added to the list of local patches displayed
574       by "perl -V".
575
576   Compilation improvements
577       As part of the flattening of ext, all extensions on all platforms are
578       built by make_ext.pl. This replaces the Unix-specific
579       ext/util/make_ext, VMS-specific make_ext.com and Win32-specific
580       win32/buildext.pl.
581
582   Platform Specific Changes
583       AIX Removed libbsd for AIX 5L and 6.1. Only "flock()" was used from
584           libbsd.
585
586           Removed libgdbm for AIX 5L and 6.1. The libgdbm is delivered as an
587           optional package with the AIX Toolbox. Unfortunately the 64 bit
588           version is broken.
589
590           Hints changes mean that AIX 4.2 should work again.
591
592       Cygwin
593           On Cygwin we now strip the last number from the DLL. This has been
594           the behaviour in the cygwin.com build for years. The hints files
595           have been updated.
596
597       DomainOS
598           Support for Apollo DomainOS was removed in Perl 5.11.0
599
600       FreeBSD
601           The hints files now identify the correct threading libraries on
602           FreeBSD 7 and later.
603
604       Irix
605           We now work around a bizarre preprocessor bug in the Irix 6.5
606           compiler: "cc -E -" unfortunately goes into K&R mode, but "cc -E
607           file.c" doesn't.
608
609       Haiku
610           Patches from the Haiku maintainers have been merged in. Perl should
611           now build on Haiku.
612
613       MachTen
614           Support for Tenon Intersystems MachTen Unix layer for MacOS Classic
615           was removed in Perl 5.11.0
616
617       MiNT
618           Support for Atari MiNT was removed in Perl 5.11.0.
619
620       MirOS BSD
621           Perl should now build on MirOS BSD.
622
623       NetBSD
624           Hints now supports versions 5.*.
625
626       Stratus VOS
627           Various changes from Stratus have been merged in.
628
629       Symbian
630           There is now support for Symbian S60 3.2 SDK and S60 5.0 SDK.
631
632       Win32
633           Improved message window handling means that "alarm" and "kill"
634           messages will no longer be dropped under race conditions.
635
636       VMS Reads from the in-memory temporary files of "PerlIO::scalar" used
637           to fail if $/ was set to a numeric reference (to indicate record-
638           style reads).  This is now fixed.
639
640           VMS now supports "getgrgid".
641
642           Many improvements and cleanups have been made to the VMS file name
643           handling and conversion code.
644
645           Enabling the "PERL_VMS_POSIX_EXIT" logical name now encodes a POSIX
646           exit status in a VMS condition value for better interaction with
647           GNV's bash shell and other utilities that depend on POSIX exit
648           values.  See "$?" in perlvms for details.
649
650           "File::Copy" now detects Unix compatibility mode on VMS.
651

Selected Bug Fixes

653       ·   "-I" on shebang line now adds directories in front of @INC as
654           documented, and as does "-I" when specified on the command-line.
655
656       ·   "kill" is now fatal when called on non-numeric process identifiers.
657           Previously, an 'undef' process identifier would be interpreted as a
658           request to kill process "0", which would terminate the current
659           process group on POSIX systems.  Since process identifiers are
660           always integers, killing a non-numeric process is now fatal.
661
662       ·   5.10.0 inadvertently disabled an optimisation, which caused a
663           measurable performance drop in list assignment, such as is often
664           used to assign function parameters from @_. The optimisation has
665           been re-instated, and the performance regression fixed.
666
667       ·   Fixed memory leak on "while (1) { map 1, 1 }" [RT #53038].
668
669       ·   Some potential coredumps in PerlIO fixed [RT #57322,54828].
670
671       ·   The debugger now works with lvalue subroutines.
672
673       ·   The debugger's "m" command was broken on modules that defined
674           constants [RT #61222].
675
676       ·   "crypt" and string complement could return tainted values for
677           untainted arguments [RT #59998].
678
679       ·   The "-i".suffix command-line switch now recreates the file using
680           restricted permissions, before changing its mode to match the
681           original file. This eliminates a potential race condition [RT
682           #60904].
683
684       ·   On some Unix systems, the value in $? would not have the top bit
685           set ("$? & 128") even if the child core dumped.
686
687       ·   Under some circumstances, $^R could incorrectly become undefined
688           [RT #57042].
689
690       ·   In the XS API, various hash functions, when passed a pre-computed
691           hash where the key is UTF-8, might result in an incorrect lookup.
692
693       ·   XS code including XSUB.h before perl.h gave a compile-time error
694           [RT #57176].
695
696       ·   "$object->isa('Foo')" would report false if the package "Foo"
697           didn't exist, even if the object's @ISA contained "Foo".
698
699       ·   Various bugs in the new-to 5.10.0 mro code, triggered by
700           manipulating @ISA, have been found and fixed.
701
702       ·   Bitwise operations on references could crash the interpreter, e.g.
703           "$x=\$y; $x |= "foo"" [RT #54956].
704
705       ·   Patterns including alternation might be sensitive to the internal
706           UTF-8 representation, e.g.
707
708               my $byte = chr(192);
709               my $utf8 = chr(192); utf8::upgrade($utf8);
710               $utf8 =~ /$byte|X}/i;       # failed in 5.10.0
711
712       ·   Within UTF8-encoded Perl source files (i.e. where "use utf8" is in
713           effect), double-quoted literal strings could be corrupted where a
714           "\xNN", "\0NNN" or "\N{}" is followed by a literal character with
715           ordinal value greater than 255 [RT #59908].
716
717       ·   "B::Deparse" failed to correctly deparse various constructs:
718           "readpipe STRING" [RT #62428], "CORE::require(STRING)" [RT #62488],
719           "sub foo(_)" [RT #62484].
720
721       ·   Using "setpgrp" with no arguments could corrupt the perl stack.
722
723       ·   The block form of "eval" is now specifically trappable by "Safe"
724           and "ops".  Previously it was erroneously treated like string
725           "eval".
726
727       ·   In 5.10.0, the two characters "[~" were sometimes parsed as the
728           smart match operator ("~~") [RT #63854].
729
730       ·   In 5.10.0, the "*" quantifier in patterns was sometimes treated as
731           "{0,32767}" [RT #60034, #60464]. For example, this match would
732           fail:
733
734               ("ab" x 32768) =~ /^(ab)*$/
735
736       ·   "shmget" was limited to a 32 bit segment size on a 64 bit OS [RT
737           #63924].
738
739       ·   Using "next" or "last" to exit a "given" block no longer produces a
740           spurious warning like the following:
741
742               Exiting given via last at foo.pl line 123
743
744       ·   On Windows, '.\foo' and '..\foo'  were treated differently than
745           './foo' and '../foo' by "do" and "require" [RT #63492].
746
747       ·   Assigning a format to a glob could corrupt the format; e.g.:
748
749                *bar=*foo{FORMAT}; # foo format now bad
750
751       ·   Attempting to coerce a typeglob to a string or number could cause
752           an assertion failure. The correct error message is now generated,
753           "Can't coerce GLOB to $type".
754
755       ·   Under "use filetest 'access'", "-x" was using the wrong access
756           mode. This has been fixed [RT #49003].
757
758       ·   "length" on a tied scalar that returned a Unicode value would not
759           be correct the first time. This has been fixed.
760
761       ·   Using an array "tie" inside in array "tie" could SEGV. This has
762           been fixed. [RT #51636]
763
764       ·   A race condition inside "PerlIOStdio_close()" has been identified
765           and fixed. This used to cause various threading issues, including
766           SEGVs.
767
768       ·   In "unpack", the use of "()" groups in scalar context was
769           internally placing a list on the interpreter's stack, which
770           manifested in various ways, including SEGVs.  This is now fixed [RT
771           #50256].
772
773       ·   Magic was called twice in "substr", "\&$x", "tie $x, $m" and
774           "chop".  These have all been fixed.
775
776       ·   A 5.10.0 optimisation to clear the temporary stack within the
777           implicit loop of "s///ge" has been reverted, as it turned out to be
778           the cause of obscure bugs in seemingly unrelated parts of the
779           interpreter [commit ef0d4e17921ee3de].
780
781       ·   The line numbers for warnings inside "elsif" are now correct.
782
783       ·   The ".." operator now works correctly with ranges whose ends are at
784           or close to the values of the smallest and largest integers.
785
786       ·   "binmode STDIN, ':raw'" could lead to segmentation faults on some
787           platforms.  This has been fixed [RT #54828].
788
789       ·   An off-by-one error meant that "index $str, ..." was effectively
790           being executed as "index "$str\0", ...". This has been fixed [RT
791           #53746].
792
793       ·   Various leaks associated with named captures in regexes have been
794           fixed [RT #57024].
795
796       ·   A weak reference to a hash would leak. This was affecting "DBI" [RT
797           #56908].
798
799       ·   Using (?|) in a regex could cause a segfault [RT #59734].
800
801       ·   Use of a UTF-8 "tr//" within a closure could cause a segfault [RT
802           #61520].
803
804       ·   Calling "Perl_sv_chop()" or otherwise upgrading an SV could result
805           in an unaligned 64-bit access on the SPARC architecture [RT
806           #60574].
807
808       ·   In the 5.10.0 release, "inc_version_list" would incorrectly list
809           "5.10.*" after "5.8.*"; this affected the @INC search order [RT
810           #67628].
811
812       ·   In 5.10.0, "pack "a*", $tainted_value" returned a non-tainted value
813           [RT #52552].
814
815       ·   In 5.10.0, "printf" and "sprintf" could produce the fatal error
816           "panic: utf8_mg_pos_cache_update" when printing UTF-8 strings [RT
817           #62666].
818
819       ·   In the 5.10.0 release, a dynamically created "AUTOLOAD" method
820           might be missed (method cache issue) [RT #60220,60232].
821
822       ·   In the 5.10.0 release, a combination of "use feature" and "//ee"
823           could cause a memory leak [RT #63110].
824
825       ·   "-C" on the shebang ("#!") line is once more permitted if it is
826           also specified on the command line. "-C" on the shebang line used
827           to be a silent no-op if it was not also on the command line, so
828           perl 5.10.0 disallowed it, which broke some scripts. Now perl
829           checks whether it is also on the command line and only dies if it
830           is not [RT #67880].
831
832       ·   In 5.10.0, certain types of re-entrant regular expression could
833           crash, or cause the following assertion failure [RT #60508]:
834
835               Assertion rx->sublen >= (s - rx->subbeg) + i failed
836
837       ·   Previously missing files from Unicode 5.1 Character Database are
838           now included.
839
840       ·   "TMPDIR" is now honored when opening an anonymous temporary file
841

New or Changed Diagnostics

843       "panic: sv_chop %s"
844           This new fatal error occurs when the C routine "Perl_sv_chop()" was
845           passed a position that is not within the scalar's string buffer.
846           This could be caused by buggy XS code, and at this point recovery
847           is not possible.
848
849       "Can't locate package %s for the parents of %s"
850           This warning has been removed. In general, it only got produced in
851           conjunction with other warnings, and removing it allowed an ISA
852           lookup optimisation to be added.
853
854       "v-string in use/require is non-portable"
855           This warning has been removed.
856
857       "Deep recursion on subroutine "%s""
858           It is now possible to change the depth threshold for this warning
859           from the default of 100, by recompiling the perl binary, setting
860           the C pre-processor macro "PERL_SUB_DEPTH_WARN" to the desired
861           value.
862

Changed Internals

864       ·   TODO: "SVt_RV" is gone. RVs are now stored in IVs
865
866       ·   TODO: REGEXPs are first class
867
868       ·   TODO: OOK is reworked, such that an OOKed scalar is PV not PVIV
869
870       ·   The J.R.R. Tolkien quotes at the head of C source file have been
871           checked and proper citations added, thanks to a patch from Tom
872           Christiansen.
873
874       ·   "Perl_vcroak()" now accepts a null first argument. In addition, a
875           full audit was made of the "not NULL" compiler annotations, and
876           those for several other internal functions were corrected.
877
878       ·   New macros "dSAVEDERRNO", "dSAVE_ERRNO", "SAVE_ERRNO",
879           "RESTORE_ERRNO" have been added to formalise the temporary saving
880           of the "errno" variable.
881
882       ·   The function "Perl_sv_insert_flags" has been added to augment
883           "Perl_sv_insert".
884
885       ·   The function "Perl_newSV_type(type)" has been added, equivalent to
886           "Perl_newSV()" followed by "Perl_sv_upgrade(type)".
887
888       ·   The function "Perl_newSVpvn_flags()" has been added, equivalent to
889           "Perl_newSVpvn()" and then performing the action relevant to the
890           flag.
891
892           Two flag bits are currently supported.
893
894           "SVf_UTF8"
895               This will call "SvUTF8_on()" for you. (Note that this does not
896               convert an sequence of ISO 8859-1 characters to UTF-8). A
897               wrapper, "newSVpvn_utf8()" is available for this.
898
899           "SVs_TEMP"
900               Call "Perl_sv_2mortal()" on the new SV.
901
902           There is also a wrapper that takes constant strings,
903           "newSVpvs_flags()".
904
905       ·   The function "Perl_croak_xs_usage" has been added as a wrapper to
906           "Perl_croak".
907
908       ·   The functions "PerlIO_find_layer" and "PerlIO_list_alloc" are now
909           exported.
910
911       ·   "PL_na" has been exterminated from the core code, replaced by local
912           STRLEN temporaries, or "*_nolen()" calls. Either approach is faster
913           than "PL_na", which is a pointer deference into the interpreter
914           structure under ithreads, and a global variable otherwise.
915
916       ·   "Perl_mg_free()" used to leave freed memory accessible via
917           "SvMAGIC()" on the scalar. It now updates the linked list to remove
918           each piece of magic as it is freed.
919
920       ·   Under ithreads, the regex in "PL_reg_curpm" is now reference
921           counted. This eliminates a lot of hackish workarounds to cope with
922           it not being reference counted.
923
924       ·   "Perl_mg_magical()" would sometimes incorrectly turn on
925           "SvRMAGICAL()".  This has been fixed.
926
927       ·   The public IV and NV flags are now not set if the string value has
928           trailing "garbage". This behaviour is consistent with not setting
929           the public IV or NV flags if the value is out of range for the
930           type.
931
932       ·   SV allocation tracing has been added to the diagnostics enabled by
933           "-Dm".  The tracing can alternatively output via the "PERL_MEM_LOG"
934           mechanism, if that was enabled when the perl binary was compiled.
935
936       ·   Smartmatch resolution tracing has been added as a new diagnostic.
937           Use "-DM" to enable it.
938
939       ·   A new debugging flag "-DB" now dumps subroutine definitions,
940           leaving "-Dx" for its original purpose of dumping syntax trees.
941
942       ·   Uses of "Nullav", "Nullcv", "Nullhv", "Nullop", "Nullsv" etc have
943           been replaced by "NULL" in the core code, and non-dual-life
944           modules, as "NULL" is clearer to those unfamiliar with the core
945           code.
946
947       ·   A macro MUTABLE_PTR(p) has been added, which on (non-pedantic) gcc
948           will not cast away "const", returning a "void *". Macros
949           "MUTABLE_SV(av)", "MUTABLE_SV(cv)" etc build on this, casting to
950           "AV *" etc without casting away "const". This allows proper
951           compile-time auditing of "const" correctness in the core, and
952           helped picked up some errors (now fixed).
953
954       ·   Macros "mPUSHs()" and "mXPUSHs()" have been added, for pushing SVs
955           on the stack and mortalizing them.
956
957       ·   Use of the private structure "mro_meta" has changed slightly.
958           Nothing outside the core should be accessing this directly anyway.
959
960       ·   A new tool, Porting/expand-macro.pl has been added, that allows you
961           to view how a C preprocessor macro would be expanded when compiled.
962           This is handy when trying to decode the macro hell that is the perl
963           guts.
964

New Tests

966       Many modules updated from CPAN incorporate new tests.
967
968       Several tests that have the potential to hang forever if they fail now
969       incorporate a "watchdog" functionality that will kill them after a
970       timeout, which helps ensure that "make test" and "make test_harness"
971       run to completion automatically. (Jerry Hedden).
972
973       Some core-specific tests have been added:
974
975       t/comp/retainedlines.t
976           Check that the debugger can retain source lines from "eval".
977
978       t/io/perlio_fail.t
979           Check that bad layers fail.
980
981       t/io/perlio_leaks.t
982           Check that PerlIO layers are not leaking.
983
984       t/io/perlio_open.t
985           Check that certain special forms of open work.
986
987       t/io/perlio.t
988           General PerlIO tests.
989
990       t/io/pvbm.t
991           Check that there is no unexpected interaction between the internal
992           types "PVBM" and "PVGV".
993
994       t/mro/package_aliases.t
995           Check that mro works properly in the presence of aliased packages.
996
997       t/op/dbm.t
998           Tests for "dbmopen" and "dbmclose".
999
1000       t/op/index_thr.t
1001           Tests for the interaction of "index" and threads.
1002
1003       t/op/pat_thr.t
1004           Tests for the interaction of esoteric patterns and threads.
1005
1006       t/op/qr_gc.t
1007           Test that "qr" doesn't leak.
1008
1009       t/op/reg_email_thr.t
1010           Tests for the interaction of regex recursion and threads.
1011
1012       t/op/regexp_qr_embed_thr.t
1013           Tests for the interaction of patterns with embedded "qr//" and
1014           threads.
1015
1016       t/op/regexp_unicode_prop.t
1017           Tests for Unicode properties in regular expressions.
1018
1019       t/op/regexp_unicode_prop_thr.t
1020           Tests for the interaction of Unicode properties and threads.
1021
1022       t/op/reg_nc_tie.t
1023           Test the tied methods of "Tie::Hash::NamedCapture".
1024
1025       t/op/reg_posixcc.t
1026           Check that POSIX character classes behave consistently.
1027
1028       t/op/re.t
1029           Check that exportable "re" functions in universal.c work.
1030
1031       t/op/setpgrpstack.t
1032           Check that "setpgrp" works.
1033
1034       t/op/substr_thr.t
1035           Tests for the interaction of "substr" and threads.
1036
1037       t/op/upgrade.t
1038           Check that upgrading and assigning scalars works.
1039
1040       t/uni/lex_utf8.t
1041           Check that Unicode in the lexer works.
1042
1043       t/uni/tie.t
1044           Check that Unicode and "tie" work.
1045

Known Problems

1047       This is a list of some significant unfixed bugs, which are regressions
1048       from either 5.10.0 or 5.8.x.
1049
1050       ·   "List::Util::first" misbehaves in the presence of a lexical $_
1051           (typically introduced by "my $_" or implicitly by "given"). The
1052           variable which gets set for each iteration is the package variable
1053           $_, not the lexical $_ [RT #67694].
1054
1055           A similar issue may occur in other modules that provide functions
1056           which take a block as their first argument, like
1057
1058               foo { ... $_ ...} list
1059
1060       ·   The "charnames" pragma may generate a run-time error when a regex
1061           is interpolated [RT #56444]:
1062
1063               use charnames ':full';
1064               my $r1 = qr/\N{THAI CHARACTER SARA I}/;
1065               "foo" =~ $r1;    # okay
1066               "foo" =~ /$r1+/; # runtime error
1067
1068           A workaround is to generate the character outside of the regex:
1069
1070               my $a = "\N{THAI CHARACTER SARA I}";
1071               my $r1 = qr/$a/;
1072
1073       ·   Some regexes may run much more slowly when run in a child thread
1074           compared with the thread the pattern was compiled into [RT #55600].
1075

Deprecations

1077       The following items are now deprecated.
1078
1079       ·   "Switch" is buggy and should be avoided. From perl 5.11.0 onwards,
1080           it is intended that any use of the core version of this module will
1081           emit a warning, and that the module will eventually be removed from
1082           the core (probably in perl 5.14.0). See "Switch statements" in
1083           perlsyn for its replacement.
1084
1085       ·   The following modules will be removed from the core distribution in
1086           a future release, and should be installed from CPAN instead.
1087           Distributions on CPAN which require these should add them to their
1088           prerequisites. The core versions of these modules warnings will
1089           issue a deprecation warning.
1090
1091           ·   "Class::ISA"
1092
1093           ·   "Pod::Plainer"
1094
1095           ·   "Shell"
1096
1097           Currently support to install from CPAN without a force is "TODO" in
1098           CPAN and CPANPLUS. This will be addressed before 5.12.0 ships.
1099
1100       ·   "suidperl" has been removed. It used to provide a mechanism to
1101           emulate setuid permission bits on systems that don't support it
1102           properly.
1103
1104       ·   Deprecate assignment to $[
1105
1106       ·   Remove attrs, which has been deprecated since 1999/10/02.
1107
1108       ·   Deprecate use of the attribute :locked on subroutines.
1109
1110       ·   Deprecate using "locked" with the attributes pragma.
1111
1112       ·   Deprecate using "unique" with the attributes pragma.
1113
1114       ·   warn if ++ or -- are unable to change the value because it's beyond
1115           the limit of representation
1116
1117           This uses a new warnings category: "imprecision".
1118
1119       ·   Make lc/uc/lcfirst/ucfirst warn when passed undef.
1120
1121       ·   Show constant in "Useless use of a constant in void context"
1122
1123       ·   Make the new warning report undef constants as undef
1124
1125       ·   Add a new warning, "Prototype after '%s'"
1126
1127       ·   Tweak the "Illegal character in prototype" warning so it's more
1128           precise when reporting illegal characters after _
1129
1130       ·   Unintended interpolation of $\ in regex
1131
1132       ·   Make overflow warnings in gmtime/localtime only occur when warnings
1133           are on
1134
1135       ·   Improve mro merging error messages.
1136
1137           They are now very similar to those produced by Algorithm::C3.
1138
1139       ·   Amelioration of the error message "Unrecognized character %s in
1140           column %d"
1141
1142           Changes the error message to "Unrecognized character %s; marked by
1143           <-- HERE after %s<-- HERE near column %d". This should make it a
1144           little simpler to spot and correct the suspicious character.
1145
1146       ·   Explicitely point to $. when it causes an uninitialized warning for
1147           ranges in scalar context
1148
1149       ·   Deprecated numerous Perl 4-era libraries:
1150
1151           termcap.pl, tainted.pl, stat.pl, shellwords.pl, pwd.pl, open3.pl,
1152           open2.pl, newgetopt.pl, look.pl, find.pl, finddepth.pl,
1153           importenv.pl, hostname.pl, getopts.pl, getopt.pl, getcwd.pl,
1154           flush.pl, fastcwd.pl, exceptions.pl, ctime.pl, complete.pl,
1155           cacheout.pl, bigrat.pl, bigint.pl, bigfloat.pl, assert.pl,
1156           abbrev.pl, dotsh.pl, and timelocal.pl are all now deprecated. Using
1157           them will incur a warning.
1158

Acknowledgements

1160       Some of the work in this release was funded by a TPF grant funded by
1161       Dijkmat BV, The Netherlands.
1162
1163       Steffen Mueller and David Golden in particular helped getting CPAN
1164       modules polished and synchronised with their in-core equivalents.
1165
1166       Craig Berry was tireless in getting maint to run under VMS, no matter
1167       how many times we broke it for him.
1168
1169       The other core committers contributed most of the changes, and applied
1170       most of the patches sent in by the hundreds of contributors listed in
1171       AUTHORS.
1172
1173       Much of the work of categorizing changes in this perldelta file was
1174       contributed by the following porters using
1175       changelogger.bestpractical.com:
1176
1177       Nicholas Clark, leon, shawn, alexm, rjbs, rafl, Pedro Melo, brunorc,
1178       anonymous, X, Tom Hukins, anonymous, Jesse, dagolden, Moritz Onken,
1179       Mark Fowler, chorny, anonymous, tmtm
1180
1181       Finally, thanks to Larry Wall, without whom none of this would be
1182       necessary.
1183

Reporting Bugs

1185       If you find what you think is a bug, you might check the articles
1186       recently posted to the comp.lang.perl.misc newsgroup and the perl bug
1187       database at http://rt.perl.org/perlbug/ .  There may also be
1188       information at http://www.perl.org/ , the Perl Home Page.
1189
1190       If you believe you have an unreported bug, please run the perlbug
1191       program included with your release.  Be sure to trim your bug down to a
1192       tiny but sufficient test case.  Your bug report, along with the output
1193       of "perl -V", will be sent off to perlbug@perl.org to be analysed by
1194       the Perl porting team.
1195
1196       If the bug you are reporting has security implications, which make it
1197       inappropriate to send to a publicly archived mailing list, then please
1198       send it to perl5-security-report@perl.org. This points to a closed
1199       subscription unarchived mailing list, which includes all the core
1200       committers, who be able to help assess the impact of issues, figure out
1201       a resolution, and help co-ordinate the release of patches to mitigate
1202       or fix the problem across all platforms on which Perl is supported.
1203       Please only use this address for security issues in the Perl core, not
1204       for modules independently distributed on CPAN.
1205

SEE ALSO

1207       The Changes file for an explanation of how to view exhaustive details
1208       on what changed.
1209
1210       The INSTALL file for how to build Perl.
1211
1212       The README file for general stuff.
1213
1214       The Artistic and Copying files for copyright information.
1215
1216
1217
1218perl v5.12.4                      2011-06-07                  PERL5110DELTA(1)
Impressum