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

NAME

6       perl5101delta - what is new for perl v5.10.1
7

DESCRIPTION

9       This document describes differences between the 5.10.0 release and the
10       5.10.1 release.
11
12       If you are upgrading from an earlier release such as 5.8.8, first read
13       the perl5100delta, which describes differences between 5.8.8 and 5.10.0
14

Incompatible Changes

16   Switch statement changes
17       The handling of complex expressions by the "given"/"when" switch
18       statement has been enhanced. There are two new cases where "when" now
19       interprets its argument as a boolean, instead of an expression to be
20       used in a smart match:
21
22       flip-flop operators
23           The ".." and "..." flip-flop operators are now evaluated in boolean
24           context, following their usual semantics; see "Range Operators" in
25           perlop.
26
27           Note that, as in perl 5.10.0, "when (1..10)" will not work to test
28           whether a given value is an integer between 1 and 10; you should
29           use "when ([1..10])" instead (note the array reference).
30
31           However, contrary to 5.10.0, evaluating the flip-flop operators in
32           boolean context ensures it can now be useful in a "when()", notably
33           for implementing bistable conditions, like in:
34
35               when (/^=begin/ .. /^=end/) {
36                 # do something
37               }
38
39       defined-or operator
40           A compound expression involving the defined-or operator, as in
41           "when (expr1 // expr2)", will be treated as boolean if the first
42           expression is boolean. (This just extends the existing rule that
43           applies to the regular or operator, as in "when (expr1 || expr2)".)
44
45       The next section details more changes brought to the semantics to the
46       smart match operator, that naturally also modify the behaviour of the
47       switch statements where smart matching is implicitly used.
48
49   Smart match changes
50       Changes to type-based dispatch
51
52       The smart match operator "~~" is no longer commutative. The behaviour
53       of a smart match now depends primarily on the type of its right hand
54       argument. Moreover, its semantics have been adjusted for greater
55       consistency or usefulness in several cases. While the general backwards
56       compatibility is maintained, several changes must be noted:
57
58       •   Code references with an empty prototype are no longer treated
59           specially.  They are passed an argument like the other code
60           references (even if they choose to ignore it).
61
62       •   "%hash ~~ sub {}" and "@array ~~ sub {}" now test that the
63           subroutine returns a true value for each key of the hash (or
64           element of the array), instead of passing the whole hash or array
65           as a reference to the subroutine.
66
67       •   Due to the commutativity breakage, code references are no longer
68           treated specially when appearing on the left of the "~~" operator,
69           but like any vulgar scalar.
70
71       •   "undef ~~ %hash" is always false (since "undef" can't be a key in a
72           hash). No implicit conversion to "" is done (as was the case in
73           perl 5.10.0).
74
75       •   "$scalar ~~ @array" now always distributes the smart match across
76           the elements of the array. It's true if one element in @array
77           verifies "$scalar ~~ $element". This is a generalization of the old
78           behaviour that tested whether the array contained the scalar.
79
80       The full dispatch table for the smart match operator is given in "Smart
81       matching in detail" in perlsyn.
82
83       Smart match and overloading
84
85       According to the rule of dispatch based on the rightmost argument type,
86       when an object overloading "~~" appears on the right side of the
87       operator, the overload routine will always be called (with a 3rd
88       argument set to a true value, see overload.) However, when the object
89       will appear on the left, the overload routine will be called only when
90       the rightmost argument is a simple scalar. This way distributivity of
91       smart match across arrays is not broken, as well as the other
92       behaviours with complex types (coderefs, hashes, regexes). Thus,
93       writers of overloading routines for smart match mostly need to worry
94       only with comparing against a scalar, and possibly with stringification
95       overloading; the other common cases will be automatically handled
96       consistently.
97
98       "~~" will now refuse to work on objects that do not overload it (in
99       order to avoid relying on the object's underlying structure). (However,
100       if the object overloads the stringification or the numification
101       operators, and if overload fallback is active, it will be used instead,
102       as usual.)
103
104   Other incompatible changes
105       •   The semantics of "use feature :5.10*" have changed slightly.  See
106           "Modules and Pragmata" for more information.
107
108       •   It is now a run-time error to use the smart match operator "~~"
109           with an object that has no overload defined for it. (This way "~~"
110           will not break encapsulation by matching against the object's
111           internal representation as a reference.)
112
113       •   The version control system used for the development of the perl
114           interpreter has been switched from Perforce to git.  This is mainly
115           an internal issue that only affects people actively working on the
116           perl core; but it may have minor external visibility, for example
117           in some of details of the output of "perl -V". See perlrepository
118           for more information.
119
120       •   The internal structure of the "ext/" directory in the perl source
121           has been reorganised. In general, a module "Foo::Bar" whose source
122           was stored under ext/Foo/Bar/ is now located under ext/Foo-Bar/.
123           Also, some modules have been moved from lib/ to ext/. This is
124           purely a source tarball change, and should make no difference to
125           the compilation or installation of perl, unless you have a very
126           customised build process that explicitly relies on this structure,
127           or which hard-codes the "nonxs_ext" Configure parameter.
128           Specifically, this change does not by default alter the location of
129           any files in the final installation.
130
131       •   As part of the "Test::Harness" 2.x to 3.x upgrade, the experimental
132           "Test::Harness::Straps" module has been removed.  See "Updated
133           Modules" for more details.
134
135       •   As part of the "ExtUtils::MakeMaker" upgrade, the
136           "ExtUtils::MakeMaker::bytes" and "ExtUtils::MakeMaker::vmsish"
137           modules have been removed from this distribution.
138
139       •   "Module::CoreList" no longer contains the %:patchlevel hash.
140
141       •   This one is actually a change introduced in 5.10.0, but it was
142           missed from that release's perldelta, so it is mentioned here
143           instead.
144
145           A bugfix related to the handling of the "/m" modifier and "qr"
146           resulted in a change of behaviour between 5.8.x and 5.10.0:
147
148               # matches in 5.8.x, doesn't match in 5.10.0
149               $re = qr/^bar/; "foo\nbar" =~ /$re/m;
150

Core Enhancements

152   Unicode Character Database 5.1.0
153       The copy of the Unicode Character Database included in Perl 5.10.1 has
154       been updated to 5.1.0 from 5.0.0. See
155       <http://www.unicode.org/versions/Unicode5.1.0/#Notable_Changes> for the
156       notable changes.
157
158   A proper interface for pluggable Method Resolution Orders
159       As of Perl 5.10.1 there is a new interface for plugging and using
160       method resolution orders other than the default (linear depth first
161       search).  The C3 method resolution order added in 5.10.0 has been re-
162       implemented as a plugin, without changing its Perl-space interface. See
163       perlmroapi for more information.
164
165   The "overloading" pragma
166       This pragma allows you to lexically disable or enable overloading for
167       some or all operations. (Yuval Kogman)
168
169   Parallel tests
170       The core distribution can now run its regression tests in parallel on
171       Unix-like platforms. Instead of running "make test", set "TEST_JOBS" in
172       your environment to the number of tests to run in parallel, and run
173       "make test_harness". On a Bourne-like shell, this can be done as
174
175           TEST_JOBS=3 make test_harness  # Run 3 tests in parallel
176
177       An environment variable is used, rather than parallel make itself,
178       because TAP::Harness needs to be able to schedule individual non-
179       conflicting test scripts itself, and there is no standard interface to
180       "make" utilities to interact with their job schedulers.
181
182       Note that currently some test scripts may fail when run in parallel
183       (most notably "ext/IO/t/io_dir.t"). If necessary run just the failing
184       scripts again sequentially and see if the failures go away.
185
186   DTrace support
187       Some support for DTrace has been added. See "DTrace support" in
188       INSTALL.
189
190   Support for "configure_requires" in CPAN module metadata
191       Both "CPAN" and "CPANPLUS" now support the "configure_requires" keyword
192       in the "META.yml" metadata file included in most recent CPAN
193       distributions.  This allows distribution authors to specify
194       configuration prerequisites that must be installed before running
195       Makefile.PL or Build.PL.
196
197       See the documentation for "ExtUtils::MakeMaker" or "Module::Build" for
198       more on how to specify "configure_requires" when creating a
199       distribution for CPAN.
200

Modules and Pragmata

202   New Modules and Pragmata
203       "autodie"
204           This is a new lexically-scoped alternative for the "Fatal" module.
205           The bundled version is 2.06_01. Note that in this release, using a
206           string eval when "autodie" is in effect can cause the autodie
207           behaviour to leak into the surrounding scope. See "BUGS" in autodie
208           for more details.
209
210       "Compress::Raw::Bzip2"
211           This has been added to the core (version 2.020).
212
213       "parent"
214           This pragma establishes an ISA relationship with base classes at
215           compile time. It provides the key feature of "base" without the
216           feature creep.
217
218       "Parse::CPAN::Meta"
219           This has been added to the core (version 1.39).
220
221   Pragmata Changes
222       "attributes"
223           Upgraded from version 0.08 to 0.09.
224
225       "attrs"
226           Upgraded from version 1.02 to 1.03.
227
228       "base"
229           Upgraded from version 2.13 to 2.14. See parent for a replacement.
230
231       "bigint"
232           Upgraded from version 0.22 to 0.23.
233
234       "bignum"
235           Upgraded from version 0.22 to 0.23.
236
237       "bigrat"
238           Upgraded from version 0.22 to 0.23.
239
240       "charnames"
241           Upgraded from version 1.06 to 1.07.
242
243           The Unicode NameAliases.txt database file has been added. This has
244           the effect of adding some extra "\N" character names that formerly
245           wouldn't have been recognised; for example, "\N{LATIN CAPITAL
246           LETTER GHA}".
247
248       "constant"
249           Upgraded from version 1.13 to 1.17.
250
251       "feature"
252           The meaning of the ":5.10" and ":5.10.X" feature bundles has
253           changed slightly. The last component, if any (i.e. "X") is simply
254           ignored.  This is predicated on the assumption that new features
255           will not, in general, be added to maintenance releases. So ":5.10"
256           and ":5.10.X" have identical effect. This is a change to the
257           behaviour documented for 5.10.0.
258
259       "fields"
260           Upgraded from version 2.13 to 2.14 (this was just a version bump;
261           there were no functional changes).
262
263       "lib"
264           Upgraded from version 0.5565 to 0.62.
265
266       "open"
267           Upgraded from version 1.06 to 1.07.
268
269       "overload"
270           Upgraded from version 1.06 to 1.07.
271
272       "overloading"
273           See "The "overloading" pragma" above.
274
275       "version"
276           Upgraded from version 0.74 to 0.77.
277
278   Updated Modules
279       "Archive::Extract"
280           Upgraded from version 0.24 to 0.34.
281
282       "Archive::Tar"
283           Upgraded from version 1.38 to 1.52.
284
285       "Attribute::Handlers"
286           Upgraded from version 0.79 to 0.85.
287
288       "AutoLoader"
289           Upgraded from version 5.63 to 5.68.
290
291       "AutoSplit"
292           Upgraded from version 1.05 to 1.06.
293
294       "B" Upgraded from version 1.17 to 1.22.
295
296       "B::Debug"
297           Upgraded from version 1.05 to 1.11.
298
299       "B::Deparse"
300           Upgraded from version 0.83 to 0.89.
301
302       "B::Lint"
303           Upgraded from version 1.09 to 1.11.
304
305       "B::Xref"
306           Upgraded from version 1.01 to 1.02.
307
308       "Benchmark"
309           Upgraded from version 1.10 to 1.11.
310
311       "Carp"
312           Upgraded from version 1.08 to 1.11.
313
314       "CGI"
315           Upgraded from version 3.29 to 3.43.  (also includes the
316           "default_value for popup_menu()" fix from 3.45).
317
318       "Compress::Zlib"
319           Upgraded from version 2.008 to 2.020.
320
321       "CPAN"
322           Upgraded from version 1.9205 to 1.9402. "CPAN::FTP" has a local fix
323           to stop it being too verbose on download failure.
324
325       "CPANPLUS"
326           Upgraded from version 0.84 to 0.88.
327
328       "CPANPLUS::Dist::Build"
329           Upgraded from version 0.06_02 to 0.36.
330
331       "Cwd"
332           Upgraded from version 3.25_01 to 3.30.
333
334       "Data::Dumper"
335           Upgraded from version 2.121_14 to 2.124.
336
337       "DB"
338           Upgraded from version 1.01 to 1.02.
339
340       "DB_File"
341           Upgraded from version 1.816_1 to 1.820.
342
343       "Devel::PPPort"
344           Upgraded from version 3.13 to 3.19.
345
346       "Digest::MD5"
347           Upgraded from version 2.36_01 to 2.39.
348
349       "Digest::SHA"
350           Upgraded from version 5.45 to 5.47.
351
352       "DirHandle"
353           Upgraded from version 1.01 to 1.03.
354
355       "Dumpvalue"
356           Upgraded from version 1.12 to 1.13.
357
358       "DynaLoader"
359           Upgraded from version 1.08 to 1.10.
360
361       "Encode"
362           Upgraded from version 2.23 to 2.35.
363
364       "Errno"
365           Upgraded from version 1.10 to 1.11.
366
367       "Exporter"
368           Upgraded from version 5.62 to 5.63.
369
370       "ExtUtils::CBuilder"
371           Upgraded from version 0.21 to 0.2602.
372
373       "ExtUtils::Command"
374           Upgraded from version 1.13 to 1.16.
375
376       "ExtUtils::Constant"
377           Upgraded from 0.20 to 0.22. (Note that neither of these versions
378           are available on CPAN.)
379
380       "ExtUtils::Embed"
381           Upgraded from version 1.27 to 1.28.
382
383       "ExtUtils::Install"
384           Upgraded from version 1.44 to 1.54.
385
386       "ExtUtils::MakeMaker"
387           Upgraded from version 6.42 to 6.55_02.
388
389           Note that "ExtUtils::MakeMaker::bytes" and
390           "ExtUtils::MakeMaker::vmsish" have been removed from this
391           distribution.
392
393       "ExtUtils::Manifest"
394           Upgraded from version 1.51_01 to 1.56.
395
396       "ExtUtils::ParseXS"
397           Upgraded from version 2.18_02 to 2.2002.
398
399       "Fatal"
400           Upgraded from version 1.05 to 2.06_01. See also the new pragma
401           "autodie".
402
403       "File::Basename"
404           Upgraded from version 2.76 to 2.77.
405
406       "File::Compare"
407           Upgraded from version 1.1005 to 1.1006.
408
409       "File::Copy"
410           Upgraded from version 2.11 to 2.14.
411
412       "File::Fetch"
413           Upgraded from version 0.14 to 0.20.
414
415       "File::Find"
416           Upgraded from version 1.12 to 1.14.
417
418       "File::Path"
419           Upgraded from version 2.04 to 2.07_03.
420
421       "File::Spec"
422           Upgraded from version 3.2501 to 3.30.
423
424       "File::stat"
425           Upgraded from version 1.00 to 1.01.
426
427       "File::Temp"
428           Upgraded from version 0.18 to 0.22.
429
430       "FileCache"
431           Upgraded from version 1.07 to 1.08.
432
433       "FileHandle"
434           Upgraded from version 2.01 to 2.02.
435
436       "Filter::Simple"
437           Upgraded from version 0.82 to 0.84.
438
439       "Filter::Util::Call"
440           Upgraded from version 1.07 to 1.08.
441
442       "FindBin"
443           Upgraded from version 1.49 to 1.50.
444
445       "GDBM_File"
446           Upgraded from version 1.08 to 1.09.
447
448       "Getopt::Long"
449           Upgraded from version 2.37 to 2.38.
450
451       "Hash::Util::FieldHash"
452           Upgraded from version 1.03 to 1.04. This fixes a memory leak.
453
454       "I18N::Collate"
455           Upgraded from version 1.00 to 1.01.
456
457       "IO"
458           Upgraded from version 1.23_01 to 1.25.
459
460           This makes non-blocking mode work on Windows in "IO::Socket::INET"
461           [CPAN #43573].
462
463       "IO::Compress::*"
464           Upgraded from version 2.008 to 2.020.
465
466       "IO::Dir"
467           Upgraded from version 1.06 to 1.07.
468
469       "IO::Handle"
470           Upgraded from version 1.27 to 1.28.
471
472       "IO::Socket"
473           Upgraded from version 1.30_01 to 1.31.
474
475       "IO::Zlib"
476           Upgraded from version 1.07 to 1.09.
477
478       "IPC::Cmd"
479           Upgraded from version 0.40_1 to 0.46.
480
481       "IPC::Open3"
482           Upgraded from version 1.02 to 1.04.
483
484       "IPC::SysV"
485           Upgraded from version 1.05 to 2.01.
486
487       "lib"
488           Upgraded from version 0.5565 to 0.62.
489
490       "List::Util"
491           Upgraded from version 1.19 to 1.21.
492
493       "Locale::MakeText"
494           Upgraded from version 1.12 to 1.13.
495
496       "Log::Message"
497           Upgraded from version 0.01 to 0.02.
498
499       "Math::BigFloat"
500           Upgraded from version 1.59 to 1.60.
501
502       "Math::BigInt"
503           Upgraded from version 1.88 to 1.89.
504
505       "Math::BigInt::FastCalc"
506           Upgraded from version 0.16 to 0.19.
507
508       "Math::BigRat"
509           Upgraded from version 0.21 to 0.22.
510
511       "Math::Complex"
512           Upgraded from version 1.37 to 1.56.
513
514       "Math::Trig"
515           Upgraded from version 1.04 to 1.20.
516
517       "Memoize"
518           Upgraded from version 1.01_02 to 1.01_03 (just a minor
519           documentation change).
520
521       "Module::Build"
522           Upgraded from version 0.2808_01 to 0.34_02.
523
524       "Module::CoreList"
525           Upgraded from version 2.13 to 2.18. This release no longer contains
526           the %Module::CoreList::patchlevel hash.
527
528       "Module::Load"
529           Upgraded from version 0.12 to 0.16.
530
531       "Module::Load::Conditional"
532           Upgraded from version 0.22 to 0.30.
533
534       "Module::Loaded"
535           Upgraded from version 0.01 to 0.02.
536
537       "Module::Pluggable"
538           Upgraded from version 3.6 to 3.9.
539
540       "NDBM_File"
541           Upgraded from version 1.07 to 1.08.
542
543       "Net::Ping"
544           Upgraded from version 2.33 to 2.36.
545
546       "NEXT"
547           Upgraded from version 0.60_01 to 0.64.
548
549       "Object::Accessor"
550           Upgraded from version 0.32 to 0.34.
551
552       "OS2::REXX"
553           Upgraded from version 1.03 to 1.04.
554
555       "Package::Constants"
556           Upgraded from version 0.01 to 0.02.
557
558       "PerlIO"
559           Upgraded from version 1.04 to 1.06.
560
561       "PerlIO::via"
562           Upgraded from version 0.04 to 0.07.
563
564       "Pod::Man"
565           Upgraded from version 2.16 to 2.22.
566
567       "Pod::Parser"
568           Upgraded from version 1.35 to 1.37.
569
570       "Pod::Simple"
571           Upgraded from version 3.05 to 3.07.
572
573       "Pod::Text"
574           Upgraded from version 3.08 to 3.13.
575
576       "POSIX"
577           Upgraded from version 1.13 to 1.17.
578
579       "Safe"
580           Upgraded from 2.12 to 2.18.
581
582       "Scalar::Util"
583           Upgraded from version 1.19 to 1.21.
584
585       "SelectSaver"
586           Upgraded from 1.01 to 1.02.
587
588       "SelfLoader"
589           Upgraded from 1.11 to 1.17.
590
591       "Socket"
592           Upgraded from 1.80 to 1.82.
593
594       "Storable"
595           Upgraded from 2.18 to 2.20.
596
597       "Switch"
598           Upgraded from version 2.13 to 2.14. Please see "Deprecations".
599
600       "Symbol"
601           Upgraded from version 1.06 to 1.07.
602
603       "Sys::Syslog"
604           Upgraded from version 0.22 to 0.27.
605
606       "Term::ANSIColor"
607           Upgraded from version 1.12 to 2.00.
608
609       "Term::ReadLine"
610           Upgraded from version 1.03 to 1.04.
611
612       "Term::UI"
613           Upgraded from version 0.18 to 0.20.
614
615       "Test::Harness"
616           Upgraded from version 2.64 to 3.17.
617
618           Note that one side-effect of the 2.x to 3.x upgrade is that the
619           experimental "Test::Harness::Straps" module (and its supporting
620           "Assert", "Iterator", "Point" and "Results" modules) have been
621           removed. If you still need this, then they are available in the
622           (unmaintained) "Test-Harness-Straps" distribution on CPAN.
623
624       "Test::Simple"
625           Upgraded from version 0.72 to 0.92.
626
627       "Text::ParseWords"
628           Upgraded from version 3.26 to 3.27.
629
630       "Text::Tabs"
631           Upgraded from version 2007.1117 to 2009.0305.
632
633       "Text::Wrap"
634           Upgraded from version 2006.1117 to 2009.0305.
635
636       "Thread::Queue"
637           Upgraded from version 2.00 to 2.11.
638
639       "Thread::Semaphore"
640           Upgraded from version 2.01 to 2.09.
641
642       "threads"
643           Upgraded from version 1.67 to 1.72.
644
645       "threads::shared"
646           Upgraded from version 1.14 to 1.29.
647
648       "Tie::RefHash"
649           Upgraded from version 1.37 to 1.38.
650
651       "Tie::StdHandle"
652           This has documentation changes, and has been assigned a version for
653           the first time: version 4.2.
654
655       "Time::HiRes"
656           Upgraded from version 1.9711 to 1.9719.
657
658       "Time::Local"
659           Upgraded from version 1.18 to 1.1901.
660
661       "Time::Piece"
662           Upgraded from version 1.12 to 1.15.
663
664       "Unicode::Normalize"
665           Upgraded from version 1.02 to 1.03.
666
667       "Unicode::UCD"
668           Upgraded from version 0.25 to 0.27.
669
670           "charinfo()" now works on Unified CJK code points added to later
671           versions of Unicode.
672
673           "casefold()" has new fields returned to provide both a simpler
674           interface and previously missing information. The old fields are
675           retained for backwards compatibility. Information about Turkic-
676           specific code points is now returned.
677
678           The documentation has been corrected and expanded.
679
680       "UNIVERSAL"
681           Upgraded from version 1.04 to 1.05.
682
683       "Win32"
684           Upgraded from version 0.34 to 0.39.
685
686       "Win32API::File"
687           Upgraded from version 0.1001_01 to 0.1101.
688
689       "XSLoader"
690           Upgraded from version 0.08 to 0.10.
691

Utility Changes

693       h2ph
694           Now looks in "include-fixed" too, which is a recent addition to
695           gcc's search path.
696
697       h2xs
698           No longer incorrectly treats enum values like macros (Daniel Burr).
699
700           Now handles C++ style constants ("//") properly in enums. (A patch
701           from Rainer Weikusat was used; Daniel Burr also proposed a similar
702           fix).
703
704       perl5db.pl
705           "LVALUE" subroutines now work under the debugger.
706
707           The debugger now correctly handles proxy constant subroutines, and
708           subroutine stubs.
709
710       perlthanks
711           Perl 5.10.1 adds a new utility perlthanks, which is a variant of
712           perlbug, but for sending non-bug-reports to the authors and
713           maintainers of Perl. Getting nothing but bug reports can become a
714           bit demoralising: we'll see if this changes things.
715

New Documentation

717       perlhaiku
718           This contains instructions on how to build perl for the Haiku
719           platform.
720
721       perlmroapi
722           This describes the new interface for pluggable Method Resolution
723           Orders.
724
725       perlperf
726           This document, by Richard Foley, provides an introduction to the
727           use of performance and optimization techniques which can be used
728           with particular reference to perl programs.
729
730       perlrepository
731           This describes how to access the perl source using the git version
732           control system.
733
734       perlthanks
735           This describes the new perlthanks utility.
736

Changes to Existing Documentation

738       The various large "Changes*" files (which listed every change made to
739       perl over the last 18 years) have been removed, and replaced by a small
740       file, also called "Changes", which just explains how that same
741       information may be extracted from the git version control system.
742
743       The file Porting/patching.pod has been deleted, as it mainly described
744       interacting with the old Perforce-based repository, which is now
745       obsolete.  Information still relevant has been moved to perlrepository.
746
747       perlapi, perlintern, perlmodlib and perltoc are now all generated at
748       build time, rather than being shipped as part of the release.
749

Performance Enhancements

751       •   A new internal cache means that "isa()" will often be faster.
752
753       •   Under "use locale", the locale-relevant information is now cached
754           on read-only values, such as the list returned by "keys %hash".
755           This makes operations such as "sort keys %hash" in the scope of
756           "use locale" much faster.
757
758       •   Empty "DESTROY" methods are no longer called.
759

Installation and Configuration Improvements

761   ext/ reorganisation
762       The layout of directories in ext has been revised. Specifically, all
763       extensions are now flat, and at the top level, with "/" in pathnames
764       replaced by "-", so that ext/Data/Dumper/ is now ext/Data-Dumper/, etc.
765       The names of the extensions as specified to Configure, and as reported
766       by %Config::Config under the keys "dynamic_ext", "known_extensions",
767       "nonxs_ext" and "static_ext" have not changed, and still use "/". Hence
768       this change will not have any affect once perl is installed. However,
769       "Attribute::Handlers", "Safe" and "mro" have now become extensions in
770       their own right, so if you run Configure with options to specify an
771       exact list of extensions to build, you will need to change it to
772       account for this.
773
774       For 5.10.2, it is planned that many dual-life modules will have been
775       moved from lib to ext; again this will have no effect on an installed
776       perl, but will matter if you invoke Configure with a pre-canned list of
777       extensions to build.
778
779   Configuration improvements
780       If "vendorlib" and "vendorarch" are the same, then they are only added
781       to @INC once.
782
783       $Config{usedevel} and the C-level "PERL_USE_DEVEL" are now defined if
784       perl is built with  "-Dusedevel".
785
786       Configure will enable use of "-fstack-protector", to provide protection
787       against stack-smashing attacks, if the compiler supports it.
788
789       Configure will now determine the correct prototypes for re-entrant
790       functions, and for "gconvert", if you are using a C++ compiler rather
791       than a C compiler.
792
793       On Unix, if you build from a tree containing a git repository, the
794       configuration process will note the commit hash you have checked out,
795       for display in the output of "perl -v" and "perl -V". Unpushed local
796       commits are automatically added to the list of local patches displayed
797       by "perl -V".
798
799   Compilation improvements
800       As part of the flattening of ext, all extensions on all platforms are
801       built by make_ext.pl. This replaces the Unix-specific
802       ext/util/make_ext, VMS-specific make_ext.com and Win32-specific
803       win32/buildext.pl.
804
805   Platform Specific Changes
806       AIX Removed libbsd for AIX 5L and 6.1. Only flock() was used from
807           libbsd.
808
809           Removed libgdbm for AIX 5L and 6.1. The libgdbm is delivered as an
810           optional package with the AIX Toolbox. Unfortunately the 64 bit
811           version is broken.
812
813           Hints changes mean that AIX 4.2 should work again.
814
815       Cygwin
816           On Cygwin we now strip the last number from the DLL. This has been
817           the behaviour in the cygwin.com build for years. The hints files
818           have been updated.
819
820       FreeBSD
821           The hints files now identify the correct threading libraries on
822           FreeBSD 7 and later.
823
824       Irix
825           We now work around a bizarre preprocessor bug in the Irix 6.5
826           compiler: "cc -E -" unfortunately goes into K&R mode, but "cc -E
827           file.c" doesn't.
828
829       Haiku
830           Patches from the Haiku maintainers have been merged in. Perl should
831           now build on Haiku.
832
833       MirOS BSD
834           Perl should now build on MirOS BSD.
835
836       NetBSD
837           Hints now supports versions 5.*.
838
839       Stratus VOS
840           Various changes from Stratus have been merged in.
841
842       Symbian
843           There is now support for Symbian S60 3.2 SDK and S60 5.0 SDK.
844
845       Win32
846           Improved message window handling means that "alarm" and "kill"
847           messages will no longer be dropped under race conditions.
848
849       VMS Reads from the in-memory temporary files of "PerlIO::scalar" used
850           to fail if $/ was set to a numeric reference (to indicate record-
851           style reads).  This is now fixed.
852
853           VMS now supports "getgrgid".
854
855           Many improvements and cleanups have been made to the VMS file name
856           handling and conversion code.
857
858           Enabling the "PERL_VMS_POSIX_EXIT" logical name now encodes a POSIX
859           exit status in a VMS condition value for better interaction with
860           GNV's bash shell and other utilities that depend on POSIX exit
861           values.  See "$?" in perlvms for details.
862

Selected Bug Fixes

864       •   5.10.0 inadvertently disabled an optimisation, which caused a
865           measurable performance drop in list assignment, such as is often
866           used to assign function parameters from @_. The optimisation has
867           been re-instated, and the performance regression fixed.
868
869       •   Fixed memory leak on "while (1) { map 1, 1 }" [RT #53038].
870
871       •   Some potential coredumps in PerlIO fixed [RT #57322,54828].
872
873       •   The debugger now works with lvalue subroutines.
874
875       •   The debugger's "m" command was broken on modules that defined
876           constants [RT #61222].
877
878       •   "crypt()" and string complement could return tainted values for
879           untainted arguments [RT #59998].
880
881       •   The "-i.suffix" command-line switch now recreates the file using
882           restricted permissions, before changing its mode to match the
883           original file. This eliminates a potential race condition [RT
884           #60904].
885
886       •   On some Unix systems, the value in $? would not have the top bit
887           set ("$? & 128") even if the child core dumped.
888
889       •   Under some circumstances, $^R could incorrectly become undefined
890           [RT #57042].
891
892       •   (XS) In various hash functions, passing a pre-computed hash to when
893           the key is UTF-8 might result in an incorrect lookup.
894
895       •   (XS) Including XSUB.h before perl.h gave a compile-time error [RT
896           #57176].
897
898       •   "$object->isa('Foo')" would report false if the package "Foo"
899           didn't exist, even if the object's @ISA contained "Foo".
900
901       •   Various bugs in the new-to 5.10.0 mro code, triggered by
902           manipulating @ISA, have been found and fixed.
903
904       •   Bitwise operations on references could crash the interpreter, e.g.
905           "$x=\$y; $x |= "foo"" [RT #54956].
906
907       •   Patterns including alternation might be sensitive to the internal
908           UTF-8 representation, e.g.
909
910               my $byte = chr(192);
911               my $utf8 = chr(192); utf8::upgrade($utf8);
912               $utf8 =~ /$byte|X}/i;       # failed in 5.10.0
913
914       •   Within UTF8-encoded Perl source files (i.e. where "use utf8" is in
915           effect), double-quoted literal strings could be corrupted where a
916           "\xNN", "\0NNN" or "\N{}" is followed by a literal character with
917           ordinal value greater than 255 [RT #59908].
918
919       •   "B::Deparse" failed to correctly deparse various constructs:
920           "readpipe STRING" [RT #62428], "CORE::require(STRING)" [RT #62488],
921           "sub foo(_)" [RT #62484].
922
923       •   Using "setpgrp()" with no arguments could corrupt the perl stack.
924
925       •   The block form of "eval" is now specifically trappable by "Safe"
926           and "ops".  Previously it was erroneously treated like string
927           "eval".
928
929       •   In 5.10.0, the two characters "[~" were sometimes parsed as the
930           smart match operator ("~~") [RT #63854].
931
932       •   In 5.10.0, the "*" quantifier in patterns was sometimes treated as
933           "{0,32767}" [RT #60034, #60464]. For example, this match would
934           fail:
935
936               ("ab" x 32768) =~ /^(ab)*$/
937
938       •   "shmget" was limited to a 32 bit segment size on a 64 bit OS [RT
939           #63924].
940
941       •   Using "next" or "last" to exit a "given" block no longer produces a
942           spurious warning like the following:
943
944               Exiting given via last at foo.pl line 123
945
946       •   On Windows, '.\foo' and '..\foo'  were treated differently than
947           './foo' and '../foo' by "do" and "require" [RT #63492].
948
949       •   Assigning a format to a glob could corrupt the format; e.g.:
950
951                *bar=*foo{FORMAT}; # foo format now bad
952
953       •   Attempting to coerce a typeglob to a string or number could cause
954           an assertion failure. The correct error message is now generated,
955           "Can't coerce GLOB to $type".
956
957       •   Under "use filetest 'access'", "-x" was using the wrong access
958           mode. This has been fixed [RT #49003].
959
960       •   "length" on a tied scalar that returned a Unicode value would not
961           be correct the first time. This has been fixed.
962
963       •   Using an array "tie" inside in array "tie" could SEGV. This has
964           been fixed. [RT #51636]
965
966       •   A race condition inside "PerlIOStdio_close()" has been identified
967           and fixed. This used to cause various threading issues, including
968           SEGVs.
969
970       •   In "unpack", the use of "()" groups in scalar context was
971           internally placing a list on the interpreter's stack, which
972           manifested in various ways, including SEGVs.  This is now fixed [RT
973           #50256].
974
975       •   Magic was called twice in "substr", "\&$x", "tie $x, $m" and
976           "chop".  These have all been fixed.
977
978       •   A 5.10.0 optimisation to clear the temporary stack within the
979           implicit loop of "s///ge" has been reverted, as it turned out to be
980           the cause of obscure bugs in seemingly unrelated parts of the
981           interpreter [commit ef0d4e17921ee3de].
982
983       •   The line numbers for warnings inside "elsif" are now correct.
984
985       •   The ".." operator now works correctly with ranges whose ends are at
986           or close to the values of the smallest and largest integers.
987
988       •   "binmode STDIN, ':raw'" could lead to segmentation faults on some
989           platforms.  This has been fixed [RT #54828].
990
991       •   An off-by-one error meant that "index $str, ..." was effectively
992           being executed as "index "$str\0", ...". This has been fixed [RT
993           #53746].
994
995       •   Various leaks associated with named captures in regexes have been
996           fixed [RT #57024].
997
998       •   A weak reference to a hash would leak. This was affecting "DBI" [RT
999           #56908].
1000
1001       •   Using (?|) in a regex could cause a segfault [RT #59734].
1002
1003       •   Use of a UTF-8 "tr//" within a closure could cause a segfault [RT
1004           #61520].
1005
1006       •   Calling "sv_chop()" or otherwise upgrading an SV could result in an
1007           unaligned 64-bit access on the SPARC architecture [RT #60574].
1008
1009       •   In the 5.10.0 release, "inc_version_list" would incorrectly list
1010           "5.10.*" after "5.8.*"; this affected the @INC search order [RT
1011           #67628].
1012
1013       •   In 5.10.0, "pack "a*", $tainted_value" returned a non-tainted value
1014           [RT #52552].
1015
1016       •   In 5.10.0, "printf" and "sprintf" could produce the fatal error
1017           "panic: utf8_mg_pos_cache_update" when printing UTF-8 strings [RT
1018           #62666].
1019
1020       •   In the 5.10.0 release, a dynamically created "AUTOLOAD" method
1021           might be missed (method cache issue) [RT #60220,60232].
1022
1023       •   In the 5.10.0 release, a combination of "use feature" and "//ee"
1024           could cause a memory leak [RT #63110].
1025
1026       •   "-C" on the shebang ("#!") line is once more permitted if it is
1027           also specified on the command line. "-C" on the shebang line used
1028           to be a silent no-op if it was not also on the command line, so
1029           perl 5.10.0 disallowed it, which broke some scripts. Now perl
1030           checks whether it is also on the command line and only dies if it
1031           is not [RT #67880].
1032
1033       •   In 5.10.0, certain types of re-entrant regular expression could
1034           crash, or cause the following assertion failure [RT #60508]:
1035
1036               Assertion rx->sublen >= (s - rx->subbeg) + i failed
1037

New or Changed Diagnostics

1039       "panic: sv_chop %s"
1040           This new fatal error occurs when the C routine "Perl_sv_chop()" was
1041           passed a position that is not within the scalar's string buffer.
1042           This could be caused by buggy XS code, and at this point recovery
1043           is not possible.
1044
1045       "Can't locate package %s for the parents of %s"
1046           This warning has been removed. In general, it only got produced in
1047           conjunction with other warnings, and removing it allowed an ISA
1048           lookup optimisation to be added.
1049
1050       "v-string in use/require is non-portable"
1051           This warning has been removed.
1052
1053       "Deep recursion on subroutine "%s""
1054           It is now possible to change the depth threshold for this warning
1055           from the default of 100, by recompiling the perl binary, setting
1056           the C pre-processor macro "PERL_SUB_DEPTH_WARN" to the desired
1057           value.
1058

Changed Internals

1060       •   The J.R.R. Tolkien quotes at the head of C source file have been
1061           checked and proper citations added, thanks to a patch from Tom
1062           Christiansen.
1063
1064       •   "vcroak()" now accepts a null first argument. In addition, a full
1065           audit was made of the "not NULL" compiler annotations, and those
1066           for several other internal functions were corrected.
1067
1068       •   New macros "dSAVEDERRNO", "dSAVE_ERRNO", "SAVE_ERRNO",
1069           "RESTORE_ERRNO" have been added to formalise the temporary saving
1070           of the "errno" variable.
1071
1072       •   The function "Perl_sv_insert_flags" has been added to augment
1073           "Perl_sv_insert".
1074
1075       •   The function "Perl_newSV_type(type)" has been added, equivalent to
1076           "Perl_newSV()" followed by "Perl_sv_upgrade(type)".
1077
1078       •   The function "Perl_newSVpvn_flags()" has been added, equivalent to
1079           "Perl_newSVpvn()" and then performing the action relevant to the
1080           flag.
1081
1082           Two flag bits are currently supported.
1083
1084           "SVf_UTF8"
1085               This will call "SvUTF8_on()" for you. (Note that this does not
1086               convert an sequence of ISO 8859-1 characters to UTF-8). A
1087               wrapper, "newSVpvn_utf8()" is available for this.
1088
1089           "SVs_TEMP"
1090               Call "sv_2mortal()" on the new SV.
1091
1092           There is also a wrapper that takes constant strings,
1093           "newSVpvs_flags()".
1094
1095       •   The function "Perl_croak_xs_usage" has been added as a wrapper to
1096           "Perl_croak".
1097
1098       •   The functions "PerlIO_find_layer" and "PerlIO_list_alloc" are now
1099           exported.
1100
1101       •   "PL_na" has been exterminated from the core code, replaced by local
1102           STRLEN temporaries, or "*_nolen()" calls. Either approach is faster
1103           than "PL_na", which is a pointer deference into the interpreter
1104           structure under ithreads, and a global variable otherwise.
1105
1106       •   "Perl_mg_free()" used to leave freed memory accessible via
1107           SvMAGIC() on the scalar. It now updates the linked list to remove
1108           each piece of magic as it is freed.
1109
1110       •   Under ithreads, the regex in "PL_reg_curpm" is now reference
1111           counted. This eliminates a lot of hackish workarounds to cope with
1112           it not being reference counted.
1113
1114       •   "Perl_mg_magical()" would sometimes incorrectly turn on
1115           "SvRMAGICAL()".  This has been fixed.
1116
1117       •   The public IV and NV flags are now not set if the string value has
1118           trailing "garbage". This behaviour is consistent with not setting
1119           the public IV or NV flags if the value is out of range for the
1120           type.
1121
1122       •   SV allocation tracing has been added to the diagnostics enabled by
1123           "-Dm".  The tracing can alternatively output via the "PERL_MEM_LOG"
1124           mechanism, if that was enabled when the perl binary was compiled.
1125
1126       •   Uses of "Nullav", "Nullcv", "Nullhv", "Nullop", "Nullsv" etc have
1127           been replaced by "NULL" in the core code, and non-dual-life
1128           modules, as "NULL" is clearer to those unfamiliar with the core
1129           code.
1130
1131       •   A macro MUTABLE_PTR(p) has been added, which on (non-pedantic) gcc
1132           will not cast away "const", returning a "void *". Macros
1133           "MUTABLE_SV(av)", "MUTABLE_SV(cv)" etc build on this, casting to
1134           "AV *" etc without casting away "const". This allows proper
1135           compile-time auditing of "const" correctness in the core, and
1136           helped picked up some errors (now fixed).
1137
1138       •   Macros "mPUSHs()" and "mXPUSHs()" have been added, for pushing SVs
1139           on the stack and mortalizing them.
1140
1141       •   Use of the private structure "mro_meta" has changed slightly.
1142           Nothing outside the core should be accessing this directly anyway.
1143
1144       •   A new tool, "Porting/expand-macro.pl" has been added, that allows
1145           you to view how a C preprocessor macro would be expanded when
1146           compiled.  This is handy when trying to decode the macro hell that
1147           is the perl guts.
1148

New Tests

1150       Many modules updated from CPAN incorporate new tests.
1151
1152       Several tests that have the potential to hang forever if they fail now
1153       incorporate a "watchdog" functionality that will kill them after a
1154       timeout, which helps ensure that "make test" and "make test_harness"
1155       run to completion automatically. (Jerry Hedden).
1156
1157       Some core-specific tests have been added:
1158
1159       t/comp/retainedlines.t
1160           Check that the debugger can retain source lines from "eval".
1161
1162       t/io/perlio_fail.t
1163           Check that bad layers fail.
1164
1165       t/io/perlio_leaks.t
1166           Check that PerlIO layers are not leaking.
1167
1168       t/io/perlio_open.t
1169           Check that certain special forms of open work.
1170
1171       t/io/perlio.t
1172           General PerlIO tests.
1173
1174       t/io/pvbm.t
1175           Check that there is no unexpected interaction between the internal
1176           types "PVBM" and "PVGV".
1177
1178       t/mro/package_aliases.t
1179           Check that mro works properly in the presence of aliased packages.
1180
1181       t/op/dbm.t
1182           Tests for "dbmopen" and "dbmclose".
1183
1184       t/op/index_thr.t
1185           Tests for the interaction of "index" and threads.
1186
1187       t/op/pat_thr.t
1188           Tests for the interaction of esoteric patterns and threads.
1189
1190       t/op/qr_gc.t
1191           Test that "qr" doesn't leak.
1192
1193       t/op/reg_email_thr.t
1194           Tests for the interaction of regex recursion and threads.
1195
1196       t/op/regexp_qr_embed_thr.t
1197           Tests for the interaction of patterns with embedded "qr//" and
1198           threads.
1199
1200       t/op/regexp_unicode_prop.t
1201           Tests for Unicode properties in regular expressions.
1202
1203       t/op/regexp_unicode_prop_thr.t
1204           Tests for the interaction of Unicode properties and threads.
1205
1206       t/op/reg_nc_tie.t
1207           Test the tied methods of "Tie::Hash::NamedCapture".
1208
1209       t/op/reg_posixcc.t
1210           Check that POSIX character classes behave consistently.
1211
1212       t/op/re.t
1213           Check that exportable "re" functions in universal.c work.
1214
1215       t/op/setpgrpstack.t
1216           Check that "setpgrp" works.
1217
1218       t/op/substr_thr.t
1219           Tests for the interaction of "substr" and threads.
1220
1221       t/op/upgrade.t
1222           Check that upgrading and assigning scalars works.
1223
1224       t/uni/lex_utf8.t
1225           Check that Unicode in the lexer works.
1226
1227       t/uni/tie.t
1228           Check that Unicode and "tie" work.
1229

Known Problems

1231       This is a list of some significant unfixed bugs, which are regressions
1232       from either 5.10.0 or 5.8.x.
1233
1234       •   "List::Util::first" misbehaves in the presence of a lexical $_
1235           (typically introduced by "my $_" or implicitly by "given"). The
1236           variable which gets set for each iteration is the package variable
1237           $_, not the lexical $_ [RT #67694].
1238
1239           A similar issue may occur in other modules that provide functions
1240           which take a block as their first argument, like
1241
1242               foo { ... $_ ...} list
1243
1244       •   The "charnames" pragma may generate a run-time error when a regex
1245           is interpolated [RT #56444]:
1246
1247               use charnames ':full';
1248               my $r1 = qr/\N{THAI CHARACTER SARA I}/;
1249               "foo" =~ $r1;    # okay
1250               "foo" =~ /$r1+/; # runtime error
1251
1252           A workaround is to generate the character outside of the regex:
1253
1254               my $a = "\N{THAI CHARACTER SARA I}";
1255               my $r1 = qr/$a/;
1256
1257       •   Some regexes may run much more slowly when run in a child thread
1258           compared with the thread the pattern was compiled into [RT #55600].
1259

Deprecations

1261       The following items are now deprecated.
1262
1263       •   "Switch" is buggy and should be avoided. From perl 5.11.0 onwards,
1264           it is intended that any use of the core version of this module will
1265           emit a warning, and that the module will eventually be removed from
1266           the core (probably in perl 5.14.0). See "Switch statements" in
1267           perlsyn for its replacement.
1268
1269       •   "suidperl" will be removed in 5.12.0. This provides a mechanism to
1270           emulate setuid permission bits on systems that don't support it
1271           properly.
1272

Acknowledgements

1274       Some of the work in this release was funded by a TPF grant.
1275
1276       Nicholas Clark officially retired from maintenance pumpking duty at the
1277       end of 2008; however in reality he has put much effort in since then to
1278       help get 5.10.1 into a fit state to be released, including writing a
1279       considerable chunk of this perldelta.
1280
1281       Steffen Mueller and David Golden in particular helped getting CPAN
1282       modules polished and synchronised with their in-core equivalents.
1283
1284       Craig Berry was tireless in getting maint to run under VMS, no matter
1285       how many times we broke it for him.
1286
1287       The other core committers contributed most of the changes, and applied
1288       most of the patches sent in by the hundreds of contributors listed in
1289       AUTHORS.
1290
1291       (Sorry to all the people I haven't mentioned by name).
1292
1293       Finally, thanks to Larry Wall, without whom none of this would be
1294       necessary.
1295

Reporting Bugs

1297       If you find what you think is a bug, you might check the articles
1298       recently posted to the comp.lang.perl.misc newsgroup and the perl bug
1299       database at http://rt.perl.org/perlbug/ .  There may also be
1300       information at http://www.perl.org/ , the Perl Home Page.
1301
1302       If you believe you have an unreported bug, please run the perlbug
1303       program included with your release.  Be sure to trim your bug down to a
1304       tiny but sufficient test case.  Your bug report, along with the output
1305       of "perl -V", will be sent off to perlbug@perl.org to be analysed by
1306       the Perl porting team.
1307
1308       If the bug you are reporting has security implications, which make it
1309       inappropriate to send to a publicly archived mailing list, then please
1310       send it to perl5-security-report@perl.org. This points to a closed
1311       subscription unarchived mailing list, which includes all the core
1312       committers, who will be able to help assess the impact of issues,
1313       figure out a resolution, and help co-ordinate the release of patches to
1314       mitigate or fix the problem across all platforms on which Perl is
1315       supported. Please only use this address for security issues in the Perl
1316       core, not for modules independently distributed on CPAN.
1317

SEE ALSO

1319       The Changes file for an explanation of how to view exhaustive details
1320       on what changed.
1321
1322       The INSTALL file for how to build Perl.
1323
1324       The README file for general stuff.
1325
1326       The Artistic and Copying files for copyright information.
1327
1328
1329
1330perl v5.36.3                      2023-11-30                  PERL5101DELTA(1)
Impressum