3 perl5110delta - what is new for perl v5.11.0
7 This document describes differences between the 5.10.0 release and
8 the 5.11.0 development release.
10 =head1 Incompatible Changes
12 =head2 Switch statement changes
14 The handling of complex expressions by the C<given>/C<when> switch
15 statement has been enhanced. There are two new cases where C<when> now
16 interprets its argument as a boolean, instead of an expression to be used
21 =item flip-flop operators
23 The C<..> and C<...> flip-flop operators are now evaluated in boolean
24 context, following their usual semantics; see L<perlop/"Range Operators">.
26 Note that, as in perl 5.10.0, C<when (1..10)> will not work to test
27 whether a given value is an integer between 1 and 10; you should use
28 C<when ([1..10])> instead (note the array reference).
30 However, contrary to 5.10.0, evaluating the flip-flop operators in boolean
31 context ensures it can now be useful in a C<when()>, notably for
32 implementing bistable conditions, like in:
34 when (/^=begin/ .. /^=end/) {
38 =item defined-or operator
40 A compound expression involving the defined-or operator, as in
41 C<when (expr1 // expr2)>, will be treated as boolean if the first
42 expression is boolean. (This just extends the existing rule that applies
43 to the regular or operator, as in C<when (expr1 || expr2)>.)
47 The next section details more changes brought to the semantics to
48 the smart match operator, that naturally also modify the behaviour
49 of the switch statements where smart matching is implicitly used.
51 =head2 Smart match changes
53 =head3 Changes to type-based dispatch
55 The smart match operator C<~~> is no longer commutative. The behaviour of
56 a smart match now depends primarily on the type of its right hand
57 argument. Moreover, its semantics have been adjusted for greater
58 consistency or usefulness in several cases. While the general backwards
59 compatibility is maintained, several changes must be noted:
65 Code references with an empty prototype are no longer treated specially.
66 They are passed an argument like the other code references (even if they
71 C<%hash ~~ sub {}> and C<@array ~~ sub {}> now test that the subroutine
72 returns a true value for each key of the hash (or element of the
73 array), instead of passing the whole hash or array as a reference to
78 Due to the commutativity breakage, code references are no longer
79 treated specially when appearing on the left of the C<~~> operator,
80 but like any vulgar scalar.
84 C<undef ~~ %hash> is always false (since C<undef> can't be a key in a
85 hash). No implicit conversion to C<""> is done (as was the case in perl
90 C<$scalar ~~ @array> now always distributes the smart match across the
91 elements of the array. It's true if one element in @array verifies
92 C<$scalar ~~ $element>. This is a generalization of the old behaviour
93 that tested whether the array contained the scalar.
97 The full dispatch table for the smart match operator is given in
98 L<perlsyn/"Smart matching in detail">.
100 =head3 Smart match and overloading
102 According to the rule of dispatch based on the rightmost argument type,
103 when an object overloading C<~~> appears on the right side of the
104 operator, the overload routine will always be called (with a 3rd argument
105 set to a true value, see L<overload>.) However, when the object will
106 appear on the left, the overload routine will be called only when the
107 rightmost argument is a simple scalar. This way distributivity of smart match
108 across arrays is not broken, as well as the other behaviours with complex
109 types (coderefs, hashes, regexes). Thus, writers of overloading routines
110 for smart match mostly need to worry only with comparing against a scalar,
111 and possibly with stringification overloading; the other common cases
112 will be automatically handled consistently.
114 C<~~> will now refuse to work on objects that do not overload it (in order
115 to avoid relying on the object's underlying structure). (However, if the
116 object overloads the stringification or the numification operators, and
117 if overload fallback is active, it will be used instead, as usual.)
119 =head2 Labels can't be keywords
121 Labels used as targets for the C<goto>, C<last>, C<next> or C<redo>
122 statements cannot be keywords anymore. This restriction will prevent
123 potential confusion between the C<goto LABEL> and C<goto EXPR> syntaxes:
124 for example, a statement like C<goto print> would jump to a label whose
125 name would be the return value of print(), (usually 1), instead of a
126 label named C<print>. Moreover, the other control flow statements
127 would just ignore any keyword passed to them as a label name. Since
128 such labels cannot be defined anymore, this kind of error will be
131 =head2 Other incompatible changes
137 The semantics of C<use feature :5.10*> have changed slightly.
138 See L<"Modules and Pragmata"> for more information.
142 It is now a run-time error to use the smart match operator C<~~>
143 with an object that has no overload defined for it. (This way
144 C<~~> will not break encapsulation by matching against the
145 object's internal representation as a reference.)
149 The version control system used for the development of the perl
150 interpreter has been switched from Perforce to git. This is mainly an
151 internal issue that only affects people actively working on the perl core;
152 but it may have minor external visibility, for example in some of details
153 of the output of C<perl -V>. See L<perlrepository> for more information.
157 The internal structure of the C<ext/> directory in the perl source has
158 been reorganised. In general, a module C<Foo::Bar> whose source was
159 stored under F<ext/Foo/Bar/> is now located under F<ext/Foo-Bar/>. Also,
160 some modules have been moved from F<lib/> to F<ext/>. This is purely a
161 source tarball change, and should make no difference to the compilation or
162 installation of perl, unless you have a very customised build process that
163 explicitly relies on this structure, or which hard-codes the C<nonxs_ext>
164 F<Configure> parameter. Specifically, this change does not by default
165 alter the location of any files in the final installation.
169 As part of the C<Test::Harness> 2.x to 3.x upgrade, the experimental
170 C<Test::Harness::Straps> module has been removed.
171 See L</"Updated Modules"> for more details.
175 As part of the C<ExtUtils::MakeMaker> upgrade, the
176 C<ExtUtils::MakeMaker::bytes> and C<ExtUtils::MakeMaker::vmsish> modules
177 have been removed from this distribution.
181 C<Module::CoreList> no longer contains the C<%:patchlevel> hash.
185 This one is actually a change introduced in 5.10.0, but it was missed
186 from that release's perldelta, so it is mentioned here instead.
188 A bugfix related to the handling of the C</m> modifier and C<qr> resulted
189 in a change of behaviour between 5.8.x and 5.10.0:
191 # matches in 5.8.x, doesn't match in 5.10.0
192 $re = qr/^bar/; "foo\nbar" =~ /$re/m;
196 =head1 Core Enhancements
198 =head2 Unicode Character Database 5.1.0
200 The copy of the Unicode Character Database included in Perl 5.10.1 has
201 been updated to 5.1.0 from 5.0.0. See
202 L<http://www.unicode.org/versions/Unicode5.1.0/#Notable_Changes> for the
205 =head2 A proper interface for pluggable Method Resolution Orders
207 As of Perl 5.10.1 there is a new interface for plugging and using method
208 resolution orders other than the default (linear depth first search).
209 The C3 method resolution order added in 5.10.0 has been re-implemented as
210 a plugin, without changing its Perl-space interface. See L<perlmroapi> for
213 =head2 The C<overloading> pragma
215 This pragma allows you to lexically disable or enable overloading
216 for some or all operations. (Yuval Kogman)
218 =head2 C<\N> regex escape
220 A new regex escape has been added, C<\N>. It will match any character that
221 is not a newline, independently from the presence or absence of the single
222 line match modifier C</s>. (If C<\N> is followed by an opening brace and
223 by a letter, perl will still assume that a Unicode character name is
224 coming, so compatibility is preserved.) (Rafael Garcia-Suarez)
226 =head2 Implicit strictures
228 Using the C<use VERSION> syntax with a version number greater or equal
229 to 5.11.0 will also lexically enable strictures just like C<use strict>
230 would do (in addition to enabling features.) So, the following:
239 =head2 Parallel tests
241 The core distribution can now run its regression tests in parallel on
242 Unix-like platforms. Instead of running C<make test>, set C<TEST_JOBS> in
243 your environment to the number of tests to run in parallel, and run
244 C<make test_harness>. On a Bourne-like shell, this can be done as
246 TEST_JOBS=3 make test_harness # Run 3 tests in parallel
248 An environment variable is used, rather than parallel make itself, because
249 L<TAP::Harness> needs to be able to schedule individual non-conflicting test
250 scripts itself, and there is no standard interface to C<make> utilities to
251 interact with their job schedulers.
253 Note that currently some test scripts may fail when run in parallel (most
254 notably C<ext/IO/t/io_dir.t>). If necessary run just the failing scripts
255 again sequentially and see if the failures go away.
257 =head2 The C<...> operator
259 A new operator, C<...>, nicknamed the Yada Yada operator, has been added.
260 It is intended to mark placeholder code, that is not yet implemented.
261 See L<perlop/"Yada Yada Operator">. (chromatic)
263 =head2 DTrace support
265 Some support for DTrace has been added. See "DTrace support" in F<INSTALL>.
267 =head2 Support for C<configure_requires> in CPAN module metadata
269 Both C<CPAN> and C<CPANPLUS> now support the C<configure_requires> keyword
270 in the C<META.yml> metadata file included in most recent CPAN distributions.
271 This allows distribution authors to specify configuration prerequisites that
272 must be installed before running F<Makefile.PL> or F<Build.PL>.
274 See the documentation for C<ExtUtils::MakeMaker> or C<Module::Build> for more
275 on how to specify C<configure_requires> when creating a distribution for CPAN.
277 =head1 Modules and Pragmata
279 =head2 New Modules and Pragmata
285 This is a new lexically-scoped alternative for the C<Fatal> module.
286 The bundled version is 2.06_01. Note that in this release, using a string
287 eval when C<autodie> is in effect can cause the autodie behaviour to leak
288 into the surrounding scope. See L<autodie/"BUGS"> for more details.
290 =item C<Compress::Raw::Bzip2>
292 This has been added to the core (version 2.020).
296 This pragma establishes an ISA relationship with base classes at compile
297 time. It provides the key feature of C<base> without the feature creep.
299 =item C<Parse::CPAN::Meta>
301 This has been added to the core (version 1.39).
305 =head2 Pragmata Changes
311 See L</"The C<overloading> pragma"> above.
315 Upgraded from version 0.08 to 0.09.
319 Upgraded from version 1.02 to 1.03.
323 Upgraded from version 2.13 to 2.14. See L<parent> for a replacement.
327 Upgraded from version 0.22 to 0.23.
331 Upgraded from version 0.22 to 0.23.
335 Upgraded from version 0.22 to 0.23.
339 Upgraded from version 1.06 to 1.07.
341 The Unicode F<NameAliases.txt> database file has been added. This has the
342 effect of adding some extra C<\N> character names that formerly wouldn't
343 have been recognised; for example, C<"\N{LATIN CAPITAL LETTER GHA}">.
347 Upgraded from version 1.13 to 1.17.
351 The meaning of the C<:5.10> and C<:5.10.X> feature bundles has
352 changed slightly. The last component, if any (i.e. C<X>) is simply ignored.
353 This is predicated on the assumption that new features will not, in
354 general, be added to maintenance releases. So C<:5.10> and C<:5.10.X>
355 have identical effect. This is a change to the behaviour documented for
360 Upgraded from version 2.13 to 2.14 (this was just a version bump; there
361 were no functional changes).
365 Upgraded from version 0.5565 to 0.62.
369 Upgraded from version 1.06 to 1.07.
373 Upgraded from version 1.06 to 1.07.
377 See L</"The C<overloading> pragma"> above.
381 Upgraded from version 0.74 to 0.77.
385 =head2 Updated Modules
389 =item C<Archive::Extract>
391 Upgraded from version 0.24 to 0.34.
393 =item C<Archive::Tar>
395 Upgraded from version 1.38 to 1.52.
397 =item C<Attribute::Handlers>
399 Upgraded from version 0.79 to 0.85.
403 Upgraded from version 5.63 to 5.68.
407 Upgraded from version 1.05 to 1.06.
411 Upgraded from version 1.17 to 1.22.
415 Upgraded from version 1.05 to 1.11.
419 Upgraded from version 0.83 to 0.89.
423 Upgraded from version 1.09 to 1.11.
427 Upgraded from version 1.01 to 1.02.
431 Upgraded from version 1.10 to 1.11.
435 Upgraded from version 1.08 to 1.11.
437 L<Carp> now includes all the necessary code to function. Previously, it
438 used to be a lightweight placeholder that loaded the actual code from
439 C<Carp::Heavy> on demand. C<Carp::Heavy> is now a simple, empty module
440 kept for backwards compatibility for programs that used to pre-load it.
445 Upgraded from version 3.29 to 3.43.
446 (also includes the "default_value for popup_menu()" fix from 3.45).
448 =item C<Compress::Zlib>
450 Upgraded from version 2.008 to 2.020.
454 Upgraded from version 1.9205 to 1.9402. C<CPAN::FTP> has a local fix to
455 stop it being too verbose on download failure.
459 Upgraded from version 0.84 to 0.88.
461 =item C<CPANPLUS::Dist::Build>
463 Upgraded from version 0.06_02 to 0.36.
467 Upgraded from version 3.25_01 to 3.30.
469 =item C<Data::Dumper>
471 Upgraded from version 2.121_14 to 2.124.
475 Upgraded from version 1.01 to 1.02.
479 Upgraded from version 1.816_1 to 1.820.
481 =item C<Devel::PPPort>
483 Upgraded from version 3.13 to 3.19.
487 Upgraded from version 2.36_01 to 2.39.
491 Upgraded from version 5.45 to 5.47.
495 Upgraded from version 1.01 to 1.03.
499 Upgraded from version 1.12 to 1.13.
503 Upgraded from version 1.08 to 1.10.
507 Upgraded from version 2.23 to 2.35.
511 Upgraded from version 1.10 to 1.11.
515 Upgraded from version 5.62 to 5.63.
517 =item C<ExtUtils::CBuilder>
519 Upgraded from version 0.21 to 0.2602.
521 =item C<ExtUtils::Command>
523 Upgraded from version 1.13 to 1.16.
525 =item C<ExtUtils::Constant>
527 Upgraded from 0.20 to 0.22. (Note that neither of these versions are
530 =item C<ExtUtils::Embed>
532 Upgraded from version 1.27 to 1.28.
534 =item C<ExtUtils::Install>
536 Upgraded from version 1.44 to 1.54.
538 =item C<ExtUtils::MakeMaker>
540 Upgraded from version 6.42 to 6.55_02.
542 Note that C<ExtUtils::MakeMaker::bytes> and C<ExtUtils::MakeMaker::vmsish>
543 have been removed from this distribution.
545 =item C<ExtUtils::Manifest>
547 Upgraded from version 1.51_01 to 1.56.
549 =item C<ExtUtils::ParseXS>
551 Upgraded from version 2.18_02 to 2.2002.
555 Upgraded from version 1.05 to 2.06_01. See also the new pragma C<autodie>.
557 =item C<File::Basename>
559 Upgraded from version 2.76 to 2.77.
561 =item C<File::Compare>
563 Upgraded from version 1.1005 to 1.1006.
567 Upgraded from version 2.11 to 2.14.
571 Upgraded from version 0.14 to 0.20.
575 Upgraded from version 1.12 to 1.14.
579 Upgraded from version 2.04 to 2.07_03.
583 Upgraded from version 3.2501 to 3.30.
587 Upgraded from version 1.00 to 1.01.
591 Upgraded from version 0.18 to 0.22.
595 Upgraded from version 1.07 to 1.08.
599 Upgraded from version 2.01 to 2.02.
601 =item C<Filter::Simple>
603 Upgraded from version 0.82 to 0.84.
605 =item C<Filter::Util::Call>
607 Upgraded from version 1.07 to 1.08.
611 Upgraded from version 1.49 to 1.50.
615 Upgraded from version 1.08 to 1.09.
617 =item C<Getopt::Long>
619 Upgraded from version 2.37 to 2.38.
621 =item C<Hash::Util::FieldHash>
623 Upgraded from version 1.03 to 1.04. This fixes a memory leak.
625 =item C<I18N::Collate>
627 Upgraded from version 1.00 to 1.01.
631 Upgraded from version 1.23_01 to 1.25.
633 This makes non-blocking mode work on Windows in C<IO::Socket::INET>
636 =item C<IO::Compress::*>
638 Upgraded from version 2.008 to 2.020.
642 Upgraded from version 1.06 to 1.07.
646 Upgraded from version 1.27 to 1.28.
650 Upgraded from version 1.30_01 to 1.31.
654 Upgraded from version 1.07 to 1.09.
658 Upgraded from version 0.40_1 to 0.46.
662 Upgraded from version 1.02 to 1.04.
666 Upgraded from version 1.05 to 2.01.
670 Upgraded from version 0.5565 to 0.62.
674 Upgraded from version 1.19 to 1.21.
676 =item C<Locale::MakeText>
678 Upgraded from version 1.12 to 1.13.
680 =item C<Log::Message>
682 Upgraded from version 0.01 to 0.02.
684 =item C<Math::BigFloat>
686 Upgraded from version 1.59 to 1.60.
688 =item C<Math::BigInt>
690 Upgraded from version 1.88 to 1.89.
692 =item C<Math::BigInt::FastCalc>
694 Upgraded from version 0.16 to 0.19.
696 =item C<Math::BigRat>
698 Upgraded from version 0.21 to 0.22.
700 =item C<Math::Complex>
702 Upgraded from version 1.37 to 1.56.
706 Upgraded from version 1.04 to 1.20.
710 Upgraded from version 1.01_02 to 1.01_03 (just a minor documentation
713 =item C<Module::Build>
715 Upgraded from version 0.2808_01 to 0.34_02.
717 =item C<Module::CoreList>
719 Upgraded from version 2.13 to 2.18. This release no longer contains the
720 C<%Module::CoreList::patchlevel> hash.
722 =item C<Module::Load>
724 Upgraded from version 0.12 to 0.16.
726 =item C<Module::Load::Conditional>
728 Upgraded from version 0.22 to 0.30.
730 =item C<Module::Loaded>
732 Upgraded from version 0.01 to 0.02.
734 =item C<Module::Pluggable>
736 Upgraded from version 3.6 to 3.9.
740 Upgraded from version 1.07 to 1.08.
744 Upgraded from version 2.33 to 2.36.
748 Upgraded from version 0.60_01 to 0.64.
750 =item C<Object::Accessor>
752 Upgraded from version 0.32 to 0.34.
756 Upgraded from version 1.03 to 1.04.
758 =item C<Package::Constants>
760 Upgraded from version 0.01 to 0.02.
764 Upgraded from version 1.04 to 1.06.
768 Upgraded from version 0.04 to 0.07.
772 Upgraded from version 2.16 to 2.22.
776 Upgraded from version 1.35 to 1.37.
780 Upgraded from version 3.05 to 3.07.
784 Upgraded from version 3.08 to 3.13.
788 Upgraded from version 1.13 to 1.17.
792 Upgraded from 2.12 to 2.18.
794 =item C<Scalar::Util>
796 Upgraded from version 1.19 to 1.21.
800 Upgraded from 1.01 to 1.02.
804 Upgraded from 1.11 to 1.17.
808 Upgraded from 1.80 to 1.82.
812 Upgraded from 2.18 to 2.20.
816 Upgraded from version 2.13 to 2.14. Please see L</Deprecations>.
820 Upgraded from version 1.06 to 1.07.
824 Upgraded from version 0.22 to 0.27.
826 =item C<Term::ANSIColor>
828 Upgraded from version 1.12 to 2.00.
830 =item C<Term::ReadLine>
832 Upgraded from version 1.03 to 1.04.
836 Upgraded from version 0.18 to 0.20.
838 =item C<Test::Harness>
840 Upgraded from version 2.64 to 3.17.
842 Note that one side-effect of the 2.x to 3.x upgrade is that the
843 experimental C<Test::Harness::Straps> module (and its supporting
844 C<Assert>, C<Iterator>, C<Point> and C<Results> modules) have been
845 removed. If you still need this, then they are available in the
846 (unmaintained) C<Test-Harness-Straps> distribution on CPAN.
848 =item C<Test::Simple>
850 Upgraded from version 0.72 to 0.92.
852 =item C<Text::ParseWords>
854 Upgraded from version 3.26 to 3.27.
858 Upgraded from version 2007.1117 to 2009.0305.
862 Upgraded from version 2006.1117 to 2009.0305.
864 =item C<Thread::Queue>
866 Upgraded from version 2.00 to 2.11.
868 =item C<Thread::Semaphore>
870 Upgraded from version 2.01 to 2.09.
874 Upgraded from version 1.67 to 1.72.
876 =item C<threads::shared>
878 Upgraded from version 1.14 to 1.29.
880 =item C<Tie::RefHash>
882 Upgraded from version 1.37 to 1.38.
884 =item C<Tie::StdHandle>
886 This has documentation changes, and has been assigned a version for the
887 first time: version 4.2.
891 Upgraded from version 1.9711 to 1.9719.
895 Upgraded from version 1.18 to 1.1901.
899 Upgraded from version 1.12 to 1.15.
901 =item C<Unicode::Normalize>
903 Upgraded from version 1.02 to 1.03.
905 =item C<Unicode::UCD>
907 Upgraded from version 0.25 to 0.27.
909 C<charinfo()> now works on Unified CJK code points added to later versions
912 C<casefold()> has new fields returned to provide both a simpler interface
913 and previously missing information. The old fields are retained for
914 backwards compatibility. Information about Turkic-specific code points is
917 The documentation has been corrected and expanded.
921 Upgraded from version 1.04 to 1.05.
925 Upgraded from version 0.34 to 0.39.
927 =item C<Win32API::File>
929 Upgraded from version 0.1001_01 to 0.1101.
933 Upgraded from version 0.08 to 0.10.
937 =head1 Utility Changes
943 Now looks in C<include-fixed> too, which is a recent addition to gcc's
948 No longer incorrectly treats enum values like macros (Daniel Burr).
950 Now handles C++ style constants (C<//>) properly in enums. (A patch from
951 Rainer Weikusat was used; Daniel Burr also proposed a similar fix).
955 C<LVALUE> subroutines now work under the debugger.
957 The debugger now correctly handles proxy constant subroutines, and
962 Perl 5.10.1 adds a new utility F<perlthanks>, which is a variant of
963 F<perlbug>, but for sending non-bug-reports to the authors and maintainers
964 of Perl. Getting nothing but bug reports can become a bit demoralising:
965 we'll see if this changes things.
969 =head1 New Documentation
975 This contains instructions on how to build perl for the Haiku platform.
979 This describes the new interface for pluggable Method Resolution Orders.
983 This document, by Richard Foley, provides an introduction to the use of
984 performance and optimization techniques which can be used with particular
985 reference to perl programs.
987 =item L<perlrepository>
989 This describes how to access the perl source using the I<git> version
994 This describes the new F<perlthanks> utility.
998 =head1 Changes to Existing Documentation
1000 The various large C<Changes*> files (which listed every change made to perl
1001 over the last 18 years) have been removed, and replaced by a small file,
1002 also called C<Changes>, which just explains how that same information may
1003 be extracted from the git version control system.
1005 The file F<Porting/patching.pod> has been deleted, as it mainly described
1006 interacting with the old Perforce-based repository, which is now obsolete.
1007 Information still relevant has been moved to L<perlrepository>.
1009 L<perlapi>, L<perlintern>, L<perlmodlib> and L<perltoc> are now all
1010 generated at build time, rather than being shipped as part of the release.
1012 =head1 Performance Enhancements
1018 A new internal cache means that C<isa()> will often be faster.
1022 Under C<use locale>, the locale-relevant information is now cached on
1023 read-only values, such as the list returned by C<keys %hash>. This makes
1024 operations such as C<sort keys %hash> in the scope of C<use locale> much
1029 Empty C<DESTROY> methods are no longer called.
1033 =head1 Installation and Configuration Improvements
1035 =head2 F<ext/> reorganisation
1037 The layout of directories in F<ext> has been revised. Specifically, all
1038 extensions are now flat, and at the top level, with C</> in pathnames
1039 replaced by C<->, so that F<ext/Data/Dumper/> is now F<ext/Data-Dumper/>,
1040 etc. The names of the extensions as specified to F<Configure>, and as
1041 reported by C<%Config::Config> under the keys C<dynamic_ext>,
1042 C<known_extensions>, C<nonxs_ext> and C<static_ext> have not changed, and
1043 still use C</>. Hence this change will not have any affect once perl is
1044 installed. However, C<Attribute::Handlers>, C<Safe> and C<mro> have now
1045 become extensions in their own right, so if you run F<Configure> with
1046 options to specify an exact list of extensions to build, you will need to
1047 change it to account for this.
1049 For 5.10.2, it is planned that many dual-life modules will have been moved
1050 from F<lib> to F<ext>; again this will have no effect on an installed
1051 perl, but will matter if you invoke F<Configure> with a pre-canned list of
1052 extensions to build.
1054 =head2 Configuration improvements
1056 If C<vendorlib> and C<vendorarch> are the same, then they are only added to
1059 C<$Config{usedevel}> and the C-level C<PERL_USE_DEVEL> are now defined if
1060 perl is built with C<-Dusedevel>.
1062 F<Configure> will enable use of C<-fstack-protector>, to provide protection
1063 against stack-smashing attacks, if the compiler supports it.
1065 F<Configure> will now determine the correct prototypes for re-entrant
1066 functions, and for C<gconvert>, if you are using a C++ compiler rather
1069 On Unix, if you build from a tree containing a git repository, the
1070 configuration process will note the commit hash you have checked out, for
1071 display in the output of C<perl -v> and C<perl -V>. Unpushed local commits
1072 are automatically added to the list of local patches displayed by
1075 =head2 Compilation improvements
1077 As part of the flattening of F<ext>, all extensions on all platforms are
1078 built by F<make_ext.pl>. This replaces the Unix-specific
1079 F<ext/util/make_ext>, VMS-specific F<make_ext.com> and Win32-specific
1080 F<win32/buildext.pl>.
1082 =head2 Platform Specific Changes
1088 Removed F<libbsd> for AIX 5L and 6.1. Only flock() was used from F<libbsd>.
1090 Removed F<libgdbm> for AIX 5L and 6.1. The F<libgdbm> is delivered as an
1091 optional package with the AIX Toolbox. Unfortunately the 64 bit version
1094 Hints changes mean that AIX 4.2 should work again.
1098 On Cygwin we now strip the last number from the DLL. This has been the
1099 behaviour in the cygwin.com build for years. The hints files have been
1104 The hints files now identify the correct threading libraries on FreeBSD 7
1109 We now work around a bizarre preprocessor bug in the Irix 6.5 compiler:
1110 C<cc -E -> unfortunately goes into K&R mode, but C<cc -E file.c> doesn't.
1114 Patches from the Haiku maintainers have been merged in. Perl should now
1119 Perl should now build on MirOS BSD.
1123 Hints now supports versions 5.*.
1127 Various changes from Stratus have been merged in.
1131 There is now support for Symbian S60 3.2 SDK and S60 5.0 SDK.
1135 Improved message window handling means that C<alarm> and C<kill> messages
1136 will no longer be dropped under race conditions.
1140 Reads from the in-memory temporary files of C<PerlIO::scalar> used to fail
1141 if C<$/> was set to a numeric reference (to indicate record-style reads).
1144 VMS now supports C<getgrgid>.
1146 Many improvements and cleanups have been made to the VMS file name handling
1147 and conversion code.
1149 Enabling the C<PERL_VMS_POSIX_EXIT> logical name now encodes a POSIX exit
1150 status in a VMS condition value for better interaction with GNV's bash
1151 shell and other utilities that depend on POSIX exit values. See
1152 L<perlvms/"$?"> for details.
1156 =head1 Selected Bug Fixes
1162 =item C<-I> on shebang line now adds directories in front of @INC.
1163 as documented, and as does C<-I> when specified on the command-line.
1168 * C<kill> is now fatal when called on non-numeric process identifiers.
1169 Previously, an 'undef' process identifier would be interpreted as a request to
1170 kill process "0", which would terminate the current process group on POSIX
1171 systems. Since process identifiers are always integers, killing a non-numeric
1172 process is now fatal.
1176 5.10.0 inadvertently disabled an optimisation, which caused a measurable
1177 performance drop in list assignment, such as is often used to assign
1178 function parameters from C<@_>. The optimisation has been re-instated, and
1179 the performance regression fixed.
1183 Fixed memory leak on C<while (1) { map 1, 1 }> [RT #53038].
1187 Some potential coredumps in PerlIO fixed [RT #57322,54828].
1191 The debugger now works with lvalue subroutines.
1195 The debugger's C<m> command was broken on modules that defined constants
1200 C<crypt()> and string complement could return tainted values for untainted
1201 arguments [RT #59998].
1205 The C<-i.suffix> command-line switch now recreates the file using
1206 restricted permissions, before changing its mode to match the original
1207 file. This eliminates a potential race condition [RT #60904].
1211 On some UNIX systems, the value in C<$?> would not have the top bit set
1212 (C<$? & 128>) even if the child core dumped.
1216 Under some circumstances, $^R could incorrectly become undefined
1221 (XS) In various hash functions, passing a pre-computed hash to when the
1222 key is UTF-8 might result in an incorrect lookup.
1226 (XS) Including F<XSUB.h> before F<perl.h> gave a compile-time error
1231 C<< $object->isa('Foo') >> would report false if the package C<Foo> didn't
1232 exist, even if the object's C<@ISA> contained C<Foo>.
1236 Various bugs in the new-to 5.10.0 mro code, triggered by manipulating
1237 C<@ISA>, have been found and fixed.
1241 Bitwise operations on references could crash the interpreter, e.g.
1242 C<$x=\$y; $x |= "foo"> [RT #54956].
1246 Patterns including alternation might be sensitive to the internal UTF-8
1247 representation, e.g.
1249 my $byte = chr(192);
1250 my $utf8 = chr(192); utf8::upgrade($utf8);
1251 $utf8 =~ /$byte|X}/i; # failed in 5.10.0
1255 Within UTF8-encoded Perl source files (i.e. where C<use utf8> is in
1256 effect), double-quoted literal strings could be corrupted where a C<\xNN>,
1257 C<\0NNN> or C<\N{}> is followed by a literal character with ordinal value
1258 greater than 255 [RT #59908].
1262 C<B::Deparse> failed to correctly deparse various constructs:
1263 C<readpipe STRING> [RT #62428], C<CORE::require(STRING)> [RT #62488],
1264 C<sub foo(_)> [RT #62484].
1268 Using C<setpgrp()> with no arguments could corrupt the perl stack.
1272 The block form of C<eval> is now specifically trappable by C<Safe> and
1273 C<ops>. Previously it was erroneously treated like string C<eval>.
1277 In 5.10.0, the two characters C<[~> were sometimes parsed as the smart
1278 match operator (C<~~>) [RT #63854].
1282 In 5.10.0, the C<*> quantifier in patterns was sometimes treated as
1283 C<{0,32767}> [RT #60034, #60464]. For example, this match would fail:
1285 ("ab" x 32768) =~ /^(ab)*$/
1289 C<shmget> was limited to a 32 bit segment size on a 64 bit OS [RT #63924].
1293 Using C<next> or C<last> to exit a C<given> block no longer produces a
1294 spurious warning like the following:
1296 Exiting given via last at foo.pl line 123
1300 On Windows, C<'.\foo'> and C<'..\foo'> were treated differently than
1301 C<'./foo'> and C<'../foo'> by C<do> and C<require> [RT #63492].
1305 Assigning a format to a glob could corrupt the format; e.g.:
1307 *bar=*foo{FORMAT}; # foo format now bad
1311 Attempting to coerce a typeglob to a string or number could cause an
1312 assertion failure. The correct error message is now generated,
1313 C<Can't coerce GLOB to I<$type>>.
1317 Under C<use filetest 'access'>, C<-x> was using the wrong access mode. This
1318 has been fixed [RT #49003].
1322 C<length> on a tied scalar that returned a Unicode value would not be
1323 correct the first time. This has been fixed.
1327 Using an array C<tie> inside in array C<tie> could SEGV. This has been
1332 A race condition inside C<PerlIOStdio_close()> has been identified and
1333 fixed. This used to cause various threading issues, including SEGVs.
1337 In C<unpack>, the use of C<()> groups in scalar context was internally
1338 placing a list on the interpreter's stack, which manifested in various
1339 ways, including SEGVs. This is now fixed [RT #50256].
1343 Magic was called twice in C<substr>, C<\&$x>, C<tie $x, $m> and C<chop>.
1344 These have all been fixed.
1348 A 5.10.0 optimisation to clear the temporary stack within the implicit
1349 loop of C<s///ge> has been reverted, as it turned out to be the cause of
1350 obscure bugs in seemingly unrelated parts of the interpreter [commit
1355 The line numbers for warnings inside C<elsif> are now correct.
1359 The C<..> operator now works correctly with ranges whose ends are at or
1360 close to the values of the smallest and largest integers.
1364 C<binmode STDIN, ':raw'> could lead to segmentation faults on some platforms.
1365 This has been fixed [RT #54828].
1369 An off-by-one error meant that C<index $str, ...> was effectively being
1370 executed as C<index "$str\0", ...>. This has been fixed [RT #53746].
1374 Various leaks associated with named captures in regexes have been fixed
1379 A weak reference to a hash would leak. This was affecting C<DBI>
1384 Using (?|) in a regex could cause a segfault [RT #59734].
1388 Use of a UTF-8 C<tr//> within a closure could cause a segfault [RT #61520].
1392 Calling C<sv_chop()> or otherwise upgrading an SV could result in an
1393 unaligned 64-bit access on the SPARC architecture [RT #60574].
1397 In the 5.10.0 release, C<inc_version_list> would incorrectly list
1398 C<5.10.*> after C<5.8.*>; this affected the C<@INC> search order
1403 In 5.10.0, C<pack "a*", $tainted_value> returned a non-tainted value
1408 In 5.10.0, C<printf> and C<sprintf> could produce the fatal error
1409 C<panic: utf8_mg_pos_cache_update> when printing UTF-8 strings
1414 In the 5.10.0 release, a dynamically created C<AUTOLOAD> method might be
1415 missed (method cache issue) [RT #60220,60232].
1419 In the 5.10.0 release, a combination of C<use feature> and C<//ee> could
1420 cause a memory leak [RT #63110].
1424 C<-C> on the shebang (C<#!>) line is once more permitted if it is also
1425 specified on the command line. C<-C> on the shebang line used to be a
1426 silent no-op I<if> it was not also on the command line, so perl 5.10.0
1427 disallowed it, which broke some scripts. Now perl checks whether it is
1428 also on the command line and only dies if it is not [RT #67880].
1432 In 5.10.0, certain types of re-entrant regular expression could crash,
1433 or cause the following assertion failure [RT #60508]:
1435 Assertion rx->sublen >= (s - rx->subbeg) + i failed
1440 =head1 New or Changed Diagnostics
1444 =item C<panic: sv_chop %s>
1446 This new fatal error occurs when the C routine C<Perl_sv_chop()> was
1447 passed a position that is not within the scalar's string buffer. This
1448 could be caused by buggy XS code, and at this point recovery is not
1451 =item C<Can't locate package %s for the parents of %s>
1453 This warning has been removed. In general, it only got produced in
1454 conjunction with other warnings, and removing it allowed an ISA lookup
1455 optimisation to be added.
1457 =item C<v-string in use/require is non-portable>
1459 This warning has been removed.
1461 =item C<Deep recursion on subroutine "%s">
1463 It is now possible to change the depth threshold for this warning from the
1464 default of 100, by recompiling the F<perl> binary, setting the C
1465 pre-processor macro C<PERL_SUB_DEPTH_WARN> to the desired value.
1469 =head1 Changed Internals
1475 The J.R.R. Tolkien quotes at the head of C source file have been checked and
1476 proper citations added, thanks to a patch from Tom Christiansen.
1480 C<vcroak()> now accepts a null first argument. In addition, a full audit
1481 was made of the "not NULL" compiler annotations, and those for several
1482 other internal functions were corrected.
1486 New macros C<dSAVEDERRNO>, C<dSAVE_ERRNO>, C<SAVE_ERRNO>, C<RESTORE_ERRNO>
1487 have been added to formalise the temporary saving of the C<errno>
1492 The function C<Perl_sv_insert_flags> has been added to augment
1497 The function C<Perl_newSV_type(type)> has been added, equivalent to
1498 C<Perl_newSV()> followed by C<Perl_sv_upgrade(type)>.
1502 The function C<Perl_newSVpvn_flags()> has been added, equivalent to
1503 C<Perl_newSVpvn()> and then performing the action relevant to the flag.
1505 Two flag bits are currently supported.
1511 This will call C<SvUTF8_on()> for you. (Note that this does not convert an
1512 sequence of ISO 8859-1 characters to UTF-8). A wrapper, C<newSVpvn_utf8()>
1513 is available for this.
1517 Call C<sv_2mortal()> on the new SV.
1521 There is also a wrapper that takes constant strings, C<newSVpvs_flags()>.
1525 The function C<Perl_croak_xs_usage> has been added as a wrapper to
1530 The functions C<PerlIO_find_layer> and C<PerlIO_list_alloc> are now
1535 C<PL_na> has been exterminated from the core code, replaced by local STRLEN
1536 temporaries, or C<*_nolen()> calls. Either approach is faster than C<PL_na>,
1537 which is a pointer deference into the interpreter structure under ithreads,
1538 and a global variable otherwise.
1542 C<Perl_mg_free()> used to leave freed memory accessible via SvMAGIC() on
1543 the scalar. It now updates the linked list to remove each piece of magic
1548 Under ithreads, the regex in C<PL_reg_curpm> is now reference counted. This
1549 eliminates a lot of hackish workarounds to cope with it not being reference
1554 C<Perl_mg_magical()> would sometimes incorrectly turn on C<SvRMAGICAL()>.
1555 This has been fixed.
1559 The I<public> IV and NV flags are now not set if the string value has
1560 trailing "garbage". This behaviour is consistent with not setting the
1561 public IV or NV flags if the value is out of range for the type.
1565 SV allocation tracing has been added to the diagnostics enabled by C<-Dm>.
1566 The tracing can alternatively output via the C<PERL_MEM_LOG> mechanism, if
1567 that was enabled when the F<perl> binary was compiled.
1571 Uses of C<Nullav>, C<Nullcv>, C<Nullhv>, C<Nullop>, C<Nullsv> etc have been
1572 replaced by C<NULL> in the core code, and non-dual-life modules, as C<NULL>
1573 is clearer to those unfamiliar with the core code.
1577 A macro C<MUTABLE_PTR(p)> has been added, which on (non-pedantic) gcc will
1578 not cast away C<const>, returning a C<void *>. Macros C<MUTABLE_SV(av)>,
1579 C<MUTABLE_SV(cv)> etc build on this, casting to C<AV *> etc without
1580 casting away C<const>. This allows proper compile-time auditing of
1581 C<const> correctness in the core, and helped picked up some errors (now
1586 Macros C<mPUSHs()> and C<mXPUSHs()> have been added, for pushing SVs on the
1587 stack and mortalizing them.
1591 Use of the private structure C<mro_meta> has changed slightly. Nothing
1592 outside the core should be accessing this directly anyway.
1596 A new tool, C<Porting/expand-macro.pl> has been added, that allows you
1597 to view how a C preprocessor macro would be expanded when compiled.
1598 This is handy when trying to decode the macro hell that is the perl
1605 Many modules updated from CPAN incorporate new tests.
1607 Several tests that have the potential to hang forever if they fail now
1608 incorporate a "watchdog" functionality that will kill them after a timeout,
1609 which helps ensure that C<make test> and C<make test_harness> run to
1610 completion automatically. (Jerry Hedden).
1612 Some core-specific tests have been added:
1616 =item t/comp/retainedlines.t
1618 Check that the debugger can retain source lines from C<eval>.
1620 =item t/io/perlio_fail.t
1622 Check that bad layers fail.
1624 =item t/io/perlio_leaks.t
1626 Check that PerlIO layers are not leaking.
1628 =item t/io/perlio_open.t
1630 Check that certain special forms of open work.
1634 General PerlIO tests.
1638 Check that there is no unexpected interaction between the internal types
1639 C<PVBM> and C<PVGV>.
1641 =item t/mro/package_aliases.t
1643 Check that mro works properly in the presence of aliased packages.
1647 Tests for C<dbmopen> and C<dbmclose>.
1649 =item t/op/index_thr.t
1651 Tests for the interaction of C<index> and threads.
1653 =item t/op/pat_thr.t
1655 Tests for the interaction of esoteric patterns and threads.
1659 Test that C<qr> doesn't leak.
1661 =item t/op/reg_email_thr.t
1663 Tests for the interaction of regex recursion and threads.
1665 =item t/op/regexp_qr_embed_thr.t
1667 Tests for the interaction of patterns with embedded C<qr//> and threads.
1669 =item t/op/regexp_unicode_prop.t
1671 Tests for Unicode properties in regular expressions.
1673 =item t/op/regexp_unicode_prop_thr.t
1675 Tests for the interaction of Unicode properties and threads.
1677 =item t/op/reg_nc_tie.t
1679 Test the tied methods of C<Tie::Hash::NamedCapture>.
1681 =item t/op/reg_posixcc.t
1683 Check that POSIX character classes behave consistently.
1687 Check that exportable C<re> functions in F<universal.c> work.
1689 =item t/op/setpgrpstack.t
1691 Check that C<setpgrp> works.
1693 =item t/op/substr_thr.t
1695 Tests for the interaction of C<substr> and threads.
1697 =item t/op/upgrade.t
1699 Check that upgrading and assigning scalars works.
1701 =item t/uni/lex_utf8.t
1703 Check that Unicode in the lexer works.
1707 Check that Unicode and C<tie> work.
1711 =head1 Known Problems
1713 This is a list of some significant unfixed bugs, which are regressions
1714 from either 5.10.0 or 5.8.x.
1720 C<List::Util::first> misbehaves in the presence of a lexical C<$_>
1721 (typically introduced by C<my $_> or implicitly by C<given>). The variable
1722 which gets set for each iteration is the package variable C<$_>, not the
1723 lexical C<$_> [RT #67694].
1725 A similar issue may occur in other modules that provide functions which
1726 take a block as their first argument, like
1728 foo { ... $_ ...} list
1732 The C<charnames> pragma may generate a run-time error when a regex is
1733 interpolated [RT #56444]:
1735 use charnames ':full';
1736 my $r1 = qr/\N{THAI CHARACTER SARA I}/;
1737 "foo" =~ $r1; # okay
1738 "foo" =~ /$r1+/; # runtime error
1740 A workaround is to generate the character outside of the regex:
1742 my $a = "\N{THAI CHARACTER SARA I}";
1747 Some regexes may run much more slowly when run in a child thread compared
1748 with the thread the pattern was compiled into [RT #55600].
1755 The following items are now deprecated.
1761 C<Switch> is buggy and should be avoided. From perl 5.11.0 onwards, it is
1762 intended that any use of the core version of this module will emit a
1763 warning, and that the module will eventually be removed from the core
1764 (probably in perl 5.14.0). See L<perlsyn/"Switch statements"> for its
1769 C<suidperl> will be removed in 5.12.0. This provides a mechanism to
1770 emulate setuid permission bits on systems that don't support it properly.
1774 =head1 Acknowledgements
1776 Some of the work in this release was funded by a TPF grant.
1778 Nicholas Clark officially retired from maintenance pumpking duty at the
1779 end of 2008; however in reality he has put much effort in since then to
1780 help get 5.10.1 into a fit state to be released, including writing a
1781 considerable chunk of this perldelta.
1783 Steffen Mueller and David Golden in particular helped getting CPAN modules
1784 polished and synchronised with their in-core equivalents.
1786 Craig Berry was tireless in getting maint to run under VMS, no matter how
1787 many times we broke it for him.
1789 The other core committers contributed most of the changes, and applied most
1790 of the patches sent in by the hundreds of contributors listed in F<AUTHORS>.
1792 Finally, thanks to Larry Wall, without whom none of this would be
1795 =head1 Reporting Bugs
1797 If you find what you think is a bug, you might check the articles
1798 recently posted to the comp.lang.perl.misc newsgroup and the perl
1799 bug database at http://rt.perl.org/perlbug/ . There may also be
1800 information at http://www.perl.org/ , the Perl Home Page.
1802 If you believe you have an unreported bug, please run the B<perlbug>
1803 program included with your release. Be sure to trim your bug down
1804 to a tiny but sufficient test case. Your bug report, along with the
1805 output of C<perl -V>, will be sent off to perlbug@perl.org to be
1806 analysed by the Perl porting team.
1808 If the bug you are reporting has security implications, which make it
1809 inappropriate to send to a publicly archived mailing list, then please send
1810 it to perl5-security-report@perl.org. This points to a closed subscription
1811 unarchived mailing list, which includes all the core committers, who be able
1812 to help assess the impact of issues, figure out a resolution, and help
1813 co-ordinate the release of patches to mitigate or fix the problem across all
1814 platforms on which Perl is supported. Please only use this address for
1815 security issues in the Perl core, not for modules independently
1816 distributed on CPAN.
1820 The F<Changes> file for an explanation of how to view exhaustive details
1823 The F<INSTALL> file for how to build Perl.
1825 The F<README> file for general stuff.
1827 The F<Artistic> and F<Copying> files for copyright information.