Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

begin filling the 5.16.0 delta from 5.15.5

This is largely a copy and paste job.  Once I copy and paste most
things in, I will then start condensing them.

This does *not* include the following sections from perl5155delta:

* module updates
* configuration and compilation changes
* internals changes
  • Loading branch information...
commit b325a3a2e3b11c481c03495d5f9088f9fd23640e 1 parent 1247744
Ricardo Signes authored

Showing 1 changed file with 314 additions and 6 deletions. Show diff stats Hide diff stats

  1. +314 6 Porting/perl5160delta.pod
320 Porting/perl5160delta.pod
Source Rendered
@@ -19,6 +19,24 @@ XXX Any important notices here
19 19
20 20 =head1 Core Enhancements
21 21
  22 +=head2 More consistent C<eval>
  23 +
  24 +The C<eval> operator sometimes treats a string argument as a sequence of
  25 +characters and sometimes as a sequence of bytes, depending on the internal
  26 +encoding. The internal encoding is not supposed to make any difference,
  27 +but there is code that relies on this inconsistency.
  28 +
  29 +Under C<use v5.15> and higher, the C<unicode_eval> and C<evalbytes>
  30 +features resolve this. The C<unicode_eval> feature causes C<eval $string>
  31 +to treat the string always as Unicode. The C<evalbytes> features provides
  32 +a function, itself called C<evalbytes>, which evaluates its argument always
  33 +as a string of bytes.
  34 +
  35 +These features also fix oddities with source filters leaking to outer
  36 +dynamic scopes.
  37 +
  38 +See L<feature> for more detail.
  39 +
22 40 =head2 $^X converted to an absolute path on FreeBSD, OS X and Solaris
23 41
24 42 C<$^X> is now converted to an absolute path on OS X, FreeBSD (without
@@ -308,6 +326,12 @@ same way as C<time>, C<fork> and other built-in functions.
308 326
309 327 =head1 Security
310 328
  329 +=head2 Privileges are now set correctly when assigning to C<$(>
  330 +
  331 +A hypothetical bug (probably non-exploitable in practice) due to the
  332 +incorrect setting of the effective group ID while setting C<$(> has been
  333 +fixed. The bug would only have affected systems that have C<setresgid()>
  334 +but not C<setregid()>, but no such systems are known of.
311 335
312 336 =head2 C<File::Glob::bsd_glob()> memory error with GLOB_ALTDIRFUNC (CVE-2011-2728).
313 337
@@ -321,6 +345,35 @@ pointers to null. Bug reported by Clément Lecigne.
321 345
322 346 =head1 Incompatible Changes
323 347
  348 +=head2 Certain deprecated Unicode properties are no longer supported by default
  349 +
  350 +Perl should never have exposed certain Unicode properties that are used
  351 +by Unicode internally and not meant to be publicly available. Use of
  352 +these has generated deprecated warning messages since Perl 5.12. The
  353 +removed properties are Other_Alphabetic,
  354 +Other_Default_Ignorable_Code_Point, Other_Grapheme_Extend,
  355 +Other_ID_Continue, Other_ID_Start, Other_Lowercase, Other_Math, and
  356 +Other_Uppercase.
  357 +
  358 +Perl may be recompiled to include any or all of them; instructions are
  359 +given in
  360 +L<perluniprops/Unicode character properties that are NOT accepted by Perl>.
  361 +
  362 +=head2 Dereferencing IO thingies as typeglobs
  363 +
  364 +The C<*{...}> operator, when passed a reference to an IO thingy (as in
  365 +C<*{*STDIN{IO}}>), creates a new typeglob containing just that IO object.
  366 +
  367 +Previously, it would stringify as an empty string, but some operators would
  368 +treat it as undefined, producing an "uninitialized" warning.
  369 +
  370 +Having a typeglob appear as an empty string is a side effect of the
  371 +implementation that has caused various bugs over the years.
  372 +
  373 +The solution was to make it stringify like a normal anonymous typeglob,
  374 +like those produced by C<< open($foo->{bar}, ...) >> [perl #96326].
  375 +
  376 +
324 377 =head2 User-defined case changing operations.
325 378
326 379 This feature was deprecated in Perl 5.14, and has now been removed.
@@ -385,11 +438,18 @@ fork.
385 438
386 439 =head1 Deprecations
387 440
388   -XXX Any deprecated features, syntax, modules etc. should be listed here.
389   -In particular, deprecated modules should be listed here even if they are
390   -listed as an updated module in the L</Modules and Pragmata> section.
  441 +=head2 Don't read the Unicode data base files in F<lib/unicore>
391 442
392   -[ List each deprecation as a =head2 entry ]
  443 +It is now deprecated to directly read the Unicode data base files.
  444 +These are stored in the F<lib/unicore> directory. Instead, you should
  445 +use the new functions in L<Unicode::UCD>. These provide a stable API,
  446 +and give complete information. (This API is, however, subject to change
  447 +somewhat during the 5.15 development cycle, as we gain experience and
  448 +get feedback from using it.)
  449 +
  450 +Perl may at some point in the future change or remove the files. The
  451 +file most likely for applications to have used is F<lib/unicore/ToDigit.pl>.
  452 +L<Unicode::UCD/prop_invmap()> can be used to get at its data instead.
393 453
394 454 =head1 Future Deprecations
395 455
@@ -405,6 +465,15 @@ to explain your use case and inform the deprecation process.
405 465
406 466 =item *
407 467
  468 +Due to changes in L<File::Glob>, Perl's C<glob> function and its
  469 +C<< <...> >> equivalent are now much faster. The splitting of the pattern
  470 +into words has been rewritten in C, resulting in speed-ups of 20% in some
  471 +cases.
  472 +
  473 +This does not affect VMS, as it does not use File::Glob.
  474 +
  475 +=item *
  476 +
408 477 The short-circuiting operators C<&&>, C<||>, and C<//>, when chained
409 478 (such as C<$a || $b || $c>), are now considerably faster to short-circuit,
410 479 due to reduced optree traversal.
@@ -449,7 +518,7 @@ cribbed.
449 518
450 519 =item *
451 520
452   -XXX
  521 +L<arybase> -- this new module implements the C<$[> variable.
453 522
454 523 =back
455 524
@@ -776,6 +845,21 @@ XXX Newly added diagnostic messages go here
776 845
777 846 =item *
778 847
  848 +L<Source filters apply only to byte streams|perldiag/"Source filters apply only to byte streams">
  849 +
  850 +This new error occurs when you try to activate a source filter (usually by
  851 +loading a source filter module) within a string passed to C<eval> under the
  852 +C<unicode_eval> feature.
  853 +
  854 +=item *
  855 +
  856 +L<That use of $[ is unsupported|perldiag/"That use of $[ is unsupported">
  857 +
  858 +This previously removed error has been restored with the re-implementation
  859 +of C<$[> as a module.
  860 +
  861 +=item *
  862 +
779 863 L<&CORE::%s cannot be called directly|perldiag/"&CORE::%s cannot be called directly">
780 864
781 865 (F) You tried to call a subroutine in the C<CORE::> namespace
@@ -792,11 +876,35 @@ called as barewords. Something like this will work:
792 876
793 877 =over 4
794 878
795   -=item L<Useless assignment to a temporary|perldiag/"Useless assignment to a temporary">
  879 +=item *
  880 +
  881 +L<Useless assignment to a temporary|perldiag/"Useless assignment to a temporary">
796 882
797 883 Assigning to a temporary returned from an XS lvalue subroutine now produces a
798 884 warning [perl #31946].
799 885
  886 +=item *
  887 +
  888 +L<length() used on %s|perldiag/length() used on %s>
  889 +
  890 +This new warning occurs when C<length> is used on an array or hash, instead
  891 +of C<scalar(@array)> or C<scalar(keys %hash)>.
  892 +
  893 +=item *
  894 +
  895 +L<$[ used in %s (did you mean $] ?)|perldiag/"$[ used in %s (did you mean $] ?)">
  896 +
  897 +This new warning exists to catch the mistaken use of C<$[> in version
  898 +checks. C<$]>, not C<$[>, contains the version number. C<$[> in a numeric
  899 +comparison is almost always wrong.
  900 +
  901 +=item *
  902 +
  903 +L<Use of assignment to $[ is deprecated|perldiag/"Use of assignment to $[ is deprecated">
  904 +
  905 +This previously removed warning has been restored with the re-implementation
  906 +of C<$[> as a module.
  907 +
800 908 =back
801 909
802 910 =head2 Changes to Existing Diagnostics
@@ -805,6 +913,18 @@ warning [perl #31946].
805 913
806 914 =item *
807 915
  916 +The uninitialized warning for C<y///r> when C<$_> is implicit and undefined
  917 +now mentions the variable name, just like the non-/r variation of the
  918 +operator.
  919 +
  920 +=item *
  921 +
  922 +The "Applying pattern match..." or similar warning produced when an array
  923 +or hash is on the left-hand side of the C<=~> operator now mentions the
  924 +name of the variable.
  925 +
  926 +=item *
  927 +
808 928 The L<Invalid version format|perldiag/"Invalid version format (%s)">
809 929 error message now says "negative version number" within the parentheses,
810 930 rather than "non-numeric data", for negative numbers.
@@ -977,6 +1097,22 @@ close some unclosed comments on F<vms/vms.c>.
977 1097
978 1098 Remove sockadapt layer from the VMS build.
979 1099
  1100 +=item GNU/Hurd
  1101 +
  1102 +Numerous build and test failures on GNU/Hurd have been resolved with hints
  1103 +for building DBM modules, detection of the library search path, and enabling
  1104 +of large file support.
  1105 +
  1106 +=item OpenVOS
  1107 +
  1108 +Perl is now built with dynamic linking on OpenVOS, the minimum supported
  1109 +version of which is now Release 17.1.0.
  1110 +
  1111 +=item SunOS
  1112 +
  1113 +The CC workshop C++ compiler is now detected and used on systems that ship
  1114 +without cc.
  1115 +
980 1116 =back
981 1117
982 1118 =head1 Internal Changes
@@ -1231,6 +1367,178 @@ fixed [perl #85026].
1231 1367
1232 1368 =item *
1233 1369
  1370 +Perl now holds an extra reference count on the package that code is
  1371 +currently compiling in. This means that the following code no longer crashes [perl #101486]:
  1372 +
  1373 + package Foo;
  1374 + BEGIN {*Foo:: = *Bar::}
  1375 + sub foo;
  1376 +
  1377 +=item *
  1378 +
  1379 +F<dumpvar.pl>, and consequently the C<x> command in the debugger, have been
  1380 +fixed to handle objects blessed into classes whose names contain "=". The
  1381 +contents of such objects used not to be dumped [perl #101814].
  1382 +
  1383 +=item *
  1384 +
  1385 +The C<x> repetition operator no longer crashes on 64-bit builds with large
  1386 +repeat counts [perl #94560].
  1387 +
  1388 +=item *
  1389 +
  1390 +A fix to C<glob> under miniperl (used to configure modules when perl itself
  1391 +is built) in Perl 5.15.3 stopped C<< <~> >> from returning the home
  1392 +directory, because it cleared %ENV before calling csh. Now C<$ENV{HOME}>
  1393 +is preserved. This fix probably does not affect anything. If
  1394 +L<File::Glob> fails to load for some reason, Perl reverts to using csh.
  1395 +So it would apply in that case.
  1396 +
  1397 +=item *
  1398 +
  1399 +On OSes other than VMS, Perl's C<glob> operator (and the C<< <...> >> form)
  1400 +use L<File::Glob> underneath. L<File::Glob> splits the pattern into words,
  1401 +before feeding each word to its C<bsd_glob> function.
  1402 +
  1403 +There were several inconsistencies in the way the split was done. Now
  1404 +quotation marks (' and ") are always treated as shell-style word delimiters
  1405 +(that allow whitespace as part of a word) and backslashes are always
  1406 +preserved, unless they exist to escape quotation marks. Before, those
  1407 +would only sometimes be the case, depending on whether the pattern
  1408 +contained whitespace. Also, escaped whitespace at the end of the pattern
  1409 +is no longer stripped [perl #40470].
  1410 +
  1411 +=item *
  1412 +
  1413 +C<CORE::glob> now works as a way to call the default globbing function. It
  1414 +used to respect overrides, despite the C<CORE::> prefix.
  1415 +
  1416 +=item *
  1417 +
  1418 +In 5.14, C</[[:lower:]]/i> and C</[[:upper:]]/i> no longer matched the
  1419 +opposite case. This has been fixed [perl #101970].
  1420 +
  1421 +=item *
  1422 +
  1423 +A regular expression match with an overloaded object on the right-hand side
  1424 +would in some cases stringify the object too many times.
  1425 +
  1426 +=item *
  1427 +
  1428 +The C-level C<pregcomp> function could become confused as to whether the
  1429 +pattern was in UTF8 if the pattern was an overloaded, tied, or otherwise
  1430 +magical scalar [perl #101940].
  1431 +
  1432 +=item *
  1433 +
  1434 +A regression has been fixed that was introduced in 5.14, in C</i>
  1435 +regular expression matching, in which a match improperly fails if the
  1436 +pattern is in UTF-8, the target string is not, and a Latin-1 character
  1437 +precedes a character in the string that should match the pattern. [perl
  1438 +#101710]
  1439 +
  1440 +=item *
  1441 +
  1442 +C<@{"..."} = reverse ...> started crashing in 5.15.3. This has been fixed.
  1443 +
  1444 +=item *
  1445 +
  1446 +C<ref> in a tainted expression started producing an "sv_upgrade" error in
  1447 +5.15.4. This has been fixed.
  1448 +
  1449 +=item *
  1450 +
  1451 +Weak references to lexical hashes going out of scope were not going stale
  1452 +(becoming undefined), but continued to point to the hash.
  1453 +
  1454 +=item *
  1455 +
  1456 +Weak references to lexical variables going out of scope are now broken
  1457 +before any magical methods (e.g., DESTROY on a tie object) are called.
  1458 +This prevents such methods from modifying the variable that will be seen
  1459 +the next time the scope is entered.
  1460 +
  1461 +=item *
  1462 +
  1463 +A C<keys> optimisation in Perl 5.12.0 to make it faster on empty hashes
  1464 +caused C<each> not to reset the iterator if called after the last element
  1465 +was deleted. This has been fixed.
  1466 +
  1467 +=item *
  1468 +
  1469 +The C<#line 42 foo> directive used not to update the arrays of lines used
  1470 +by the debugger if it occurred in a string eval. This was partially fixed
  1471 +in 5.14, but it only worked for a single C<#line 42 foo> in each eval. Now
  1472 +it works for multiple.
  1473 +
  1474 +=item *
  1475 +
  1476 +String eval used not to localise C<%^H> when compiling its argument if it
  1477 +was empty at the time the C<eval> call itself was compiled. This could
  1478 +lead to scary side effects, like C<use re "/m"> enabling other flags that
  1479 +the surrounding code was trying to enable for its caller [perl #68750].
  1480 +
  1481 +=item *
  1482 +
  1483 +Creating a BEGIN block from XS code (via C<newXS> or C<newATTRSUB>) would,
  1484 +on completion, make the hints of the current compiling code the current
  1485 +hints. This could cause warnings to occur in a non-warning scope.
  1486 +
  1487 +=item *
  1488 +
  1489 +C<eval $string> and C<require> no longer localise hints (C<$^H> and C<%^H>)
  1490 +at run time, but only during compilation of the $string or required file.
  1491 +This makes C<BEGIN { $^H{foo}=7 }> equivalent to
  1492 +C<BEGIN { eval '$^H{foo}=7' }> [perl #70151].
  1493 +
  1494 +=item *
  1495 +
  1496 +When subroutine calls are intercepted by the debugger, the name of the
  1497 +subroutine or a reference to it is stored in C<$DB::sub>, for the debugger
  1498 +to access. In some cases (such as C<$foo = *bar; undef *bar; &$foo>)
  1499 +C<$DB::sub> would be set to a name that could not be used to find the
  1500 +subroutine, and so the debugger's attempt to call it would fail. Now the
  1501 +check to see whether a reference is needed is more robust, so those
  1502 +problems should not happen anymore [rt.cpan.org #69862].
  1503 +
  1504 +=item *
  1505 +
  1506 +Localising a tied scalar that returns a typeglob no longer stops it from
  1507 +being tied till the end of the scope.
  1508 +
  1509 +=item *
  1510 +
  1511 +When C<open> is called with three arguments, the third being a file handle
  1512 +(as in C<< open $fh, ">&", $fh2 >>), if the third argument is tied or a
  1513 +reference to a tied variable, FETCH is now called exactly once, instead of
  1514 +0, 2, or 3 times (all of which could occur in various circumstances).
  1515 +
  1516 +=item *
  1517 +
  1518 +C<sort> no longer ignores FETCH when passed a reference to a tied glob for
  1519 +the comparison routine.
  1520 +
  1521 +=item *
  1522 +
  1523 +Warnings emitted by C<sort> when a custom comparison routine returns a
  1524 +non-numeric value now show the line number of the C<sort> operator, rather
  1525 +than the last line of the comparison routine. The warnings also occur now
  1526 +only if warnings are enabled in the scope where C<sort> occurs. Previously
  1527 +the warnings would occur if enabled in the comparison routine's scope.
  1528 +
  1529 +=item *
  1530 +
  1531 +C<Internals::SvREFCNT> now behaves consistently in 'get' and 'set' scenarios
  1532 +[perl #103222] and also treats the reference count as unsigned.
  1533 +
  1534 +=item *
  1535 +
  1536 +Calling C<require> on an implicit C<$_> when C<*CORE::GLOBAL::require> has
  1537 +been overridden does not segfault anymore, and C<$_> is now passed to the
  1538 +overriding subroutine [perl #78260].
  1539 +
  1540 +=item *
  1541 +
1234 1542 In Perl 5.14.0, C<$tainted ~~ @array> stopped working properly. Sometimes
1235 1543 it would erroneously fail (when C<$tainted> contained a string that occurs
1236 1544 in the array I<after> the first element) or erroneously succeed (when

0 comments on commit b325a3a

Please sign in to comment.
Something went wrong with that request. Please try again.