perl5280cdelta - what is new for cperl v5.28.0
This document describes differences between the cperl 5.26.2 and the cperl 5.28.0 release.
If you are upgrading from an earlier release such as v5.26.1c, first read perl5262cdelta, which describes differences between v5.26.1c and v5.26.2c.
The new cperl classes/roles have still some "LIMITATIONS" in perlclass.
cperl did not change the subroutine attribute and signature order. This is the most damaging significant syntax change to date, even worse than the unnecessary for (qw())
change, rendering all existing attribute based frameworks useless. This change would have required a major version bump to perl7. Any minor problem with the wrong order of evaluation should have been fixed internally and transparent to the established syntax.
For all perl5 changes which were rejected in cperl 5.28 see https://github.com/perl11/cperl/issues/356 and https://github.com/perl11/cperl/issues/337.
study does not stringify hashes anymore, it rather calls the new hv_study function on hashes, which optimizes the internal structure of a hash. Currently clears all placeholders, and optionally shrinks its size if the new size falls below a power of two. On code, regex and arrays it does nothing yet, but might add type optimizations on the current dynamic status. cperl-only.
Added use strict 'hashpairs'
to allow only pairs for hash assignments, within a map even only an empty or single pair. See [cperl #281. cperl-only.
With any of three supported BOMs set use utf8
and use feature 'unicode_strings'
at compile-time as documented until perl 5.26.
With 5.26 perl5 decided to change the documentation to match the broken implementation. With cperl 5.27.0c the implementation was fixed instead. See [cperl #269] and [perl #121292]. cperl-only.
Avoid undoable and unsafe sideeffects (io, ...) in the CHECK mode, esp. for editor syntax checks. See [cperl #263]
Essentially prepend -Mops=:browse,:load,print
with -c:s
. cperl-only.
cperl has now the class
, role
, method
and has
keywords as in perl6, fields was extended. has fields are lexically scoped variables, available in all methods and internally represented via oelem OPs and fields. multi
methods are not yet supported. There are no perl6-like public, private sigils, use the _
prefix as convention for private. See perlclass.
Old user-subroutines or parser-hacks with these names are still supported, but not recommended. B does not export class anymore.
Before symbols and identifiers created from strings at run-time were added asis. Now those names are treated almost as in the parser at compile-time, i.e. unicode is normalized, mixed Unicode scripts are checked at run-time also. cperl-only.
Behaviour of "valid_ident" in perlapi:
${"\xc3\x28"} => FALSE. Illegal unicode, but no warning or error,
unless under strict names.
${"E\x{45}\x{301}"} => TRUE. Normalized to $E\x{c9}
${"एxṰர::ʦፖㄡsȨ"} => FALSE. Error: Invalid script Tamil in identifier
ர::ʦፖㄡsȨ for U+0BB0. Have Devanagari
See below "strict names". use strict
fatalizes now any run-time identifier parsing problem. cperl-only.
strict names is the default when using use strict
. Reject illegal identifiers at run-time when created dynamically from strings, which would be rejected at compile-time. cperl-only.
use strict "names";
${"\$var"} => Invalid identifier "$var" while "strict names"
${"\xff"} => Invalid identifier "\377" while "strict names"
${"\xc3\x28"} => Invalid identifier "\303(" while "strict names"
See "Identifier parsing" in perldata and http://perl11.github.io/blog/strict-names.html cperl-only.
When a method call can be proven at compile-time to use a specific subroutine, optimize away the run-time method dispatch on a non-threaded perl. When it is for a XS subroutine, such as with e.g. use strict;
which does BEGIN {require strict;} strict->import;
the strict->import
part is optimized from the slow entersub
op to the enterxssub
op, as if via strict::import("strict",...)
. The slow GV lookup in entersub cannot be converted to a faster CVref lookup, as this would break dynamic method redefinitions. See http://blogs.perl.org/users/rurban/2011/06/how-perl-calls-subs-and-methods.html. This is ~4% faster for each such method call. cperl-only.
Support named anonymous CV names, i.e. orphaned or interim subroutine names are not changed to __ANON__
anymore, but a @
character is appended. The @
character is also used to identify numbered special blocks like BEGIN@1
in Devel::NYTProf and later to name and identify multi methods (polymorphism).
Dump the values of a COP $^H
, %^H
and the lexical warnings via op_dump()
and it's XS module Devel::Peek. Improve the display of cop SEQ values and ranges, and padnames. Added a DEBUGGING cop_dump()
helper, esp. useful for deleted PL_curcop
's. cperl-only.
Added the strong unicode fraction op /
U+2044, which binds stronger than all other arithmetic ops, and the two unicode multiplication ops ⋅
U+022C5 (dot operator) and ∙
U+2219 (multiplication dot), which binds the same as *
. cperl-only.
'
is a valid part of a subroutine nameAccept '
as valid subroutine name character in declarations, if in the middle, just don't expand it to ::
. This allows: sub don't { ... }
but not sub do' {}
nor sub 'do {}
.
Unfortunately using this name is not yet as easy as before, when the '
was expanded to ::
. print don't;
is illegal, as the quote looks for the 2nd string delimiter pair, and doesn't yet check for the existing subroutine name.
In XS you can check for the define PERL_NO_QUOTE_PKGSEPERATOR
how the quote is handled.
delete can now be used on key/value slices, returning the keys along with the deleted values. [perl #131328]
A list of changes is at http://www.unicode.org/versions/Unicode10.0.0.
If you find it difficult to remember how to write certain of the pattern assertions, there are now alphabetic synonyms.
CURRENT NEW SYNONYMS
------ ------------
(?=...) (*pla:...) or (*positive_lookahead:...)
(?!...) (*nla:...) or (*negative_lookahead:...)
(?<=...) (*plb:...) or (*positive_lookbehind:...)
(?<!...) (*nlb:...) or (*negative_lookbehind:...)
(?>...) (*atomic:...)
These are considered experimental, so using any of these will raise (unless turned off) a warning in the experimental::alpha_assertions
category.
Parse prototypes for errors again. Either with :prototype()
or as signature. Illegal prototypes are not stored. Most illegal protos are subsequently parsed as signature, but some are just wrong protos, such as '[$'
missing the ']'
, or :prototype($_$)
.
Previously in-place editing would delete or rename the input file as soon as you started working on a new file.
Without backups this would result in loss of data if there was an error, such as a full disk, when writing to the output file.
This has changed so that the input file isn't replaced until the output file has been completely written and successfully closed.
This works by creating a work file in the same directory, which is renamed over the input file once the output file is complete.
Incompatibilities:
Since this renaming needs to only happen once, if you create a thread or child process, that renaming will only happen in the original thread or process.
If you change directories while processing a file, and your operating system doesn't provide the unlinkat()
, renameat()
and fchmodat()
functions, the final rename step may fail.
A persistent lexical array or hash variable can now be initialized, by an expression such as state @a = qw(x y z)
. Initialization of a list of persistent lexical variables is still not possible.
On platforms where inode numbers are of a type larger than perl's native integer numerical types, stat will preserve the full content of large inode numbers by returning them in the form of strings of decimal digits. Exact comparison of inode numbers can thus be achieved by comparing with eq
rather than ==
. Comparison with ==
, and other numerical operations (which are usually meaningless on inode numbers), work as well as they did before, which is to say they fall back to floating point, and ultimately operate on a fairly useless rounded inode number if the real inode number is too big for the floating point format.
If a scope used "use warnings 'all'" to turn on all warnings and then turned off some specific warnings, then that scope wouldn't get warnings for subsequently-registered warning categories, because its bitset doesn't extend to the bit controlling the new category.
Unlike all other warning categories, the bits for "all" used to be set only when there were no warning categories disabled; disabling any would also clear the "all" bits. That was supporting the dynamic nature of warnings::register extending the all-warnings bitset for new categories. This exception is now removed, so the meaning of the "all" bits is now the more obvious meaning, of indicating the default treatment that the scope wants for warnings not falling into any category known to the bitset. In warnings::warnif()
et al, if the caller's bitset is found to be too short to have a bit for the relevant category, then the setting for the "all" category is used instead.
Because the length of a bitset is an integral number of bytes, but only two bits are used per category, the length of a bitset doesn't precisely indicate which categories had been registered by the time it was constructed. So the standard bitsets for the "all" category are now always filled to their byte length, with bits set preemptively for categories not yet registered that fall within the current bitset length.
When a warnings pragma operates on a bitset, it first expands it to the preferred length, by duplicating the "all" bits for the categories covered by the new length. It is careful to maintain the length when combining the bitset with the standard bitsets for categories. When a bitset is read from ${^WARNING_BITS}
or from caller()
, the standard pWARN_ALL
setting is no longer expanded by the core to $warnings::Bits{all}
, because the core's short WARN_ALLstring
will now be expanded correctly just like any other bitset.
Fixes [perl #108778]
This is now a valid shaped array delaration, with the lhs array size computed from the number of constant elements in the rhs list expressions. The array must only consist of compile-time scalars.
my @a[] = (0,1,2);
my @a[];
without assignment is still a syntax error.
See [cperl #210] cperl-only.
${^SAFE_LOCALES}
This variable is 1 if the Perl interpreter is operating in an environment where it is safe to use and change locales (see perllocale.) This variable is true when the perl is unthreaded, or compiled in a platform that supports thread-safe locale operation (see next item).
These systems include Windows starting with Visual Studio 2005 and POSIX 2008 systems.
The implication is that you are now free to use locales and changes them in a threaded environment. Your changes affect only your thread. See "Multi-threaded operation" in perllocale
perl5 added a string check via regex for mixed unicode scripts, which might be marginally useful. Note that this feature doesn't prevent from security attacks as cperl identifier protections. Only cperl detects mixed unicode scripts in identifiers.
A mixture of scripts, such as Cyrillic and Latin, in a string is often the sign of a spoofing attack. A new regular expression construct now allows for easy detection of these. For example, you can say
qr/(*script_run: \d+ \b )/x
And the digits matched will all be from the same set of 10. You won't get a look-alike digit from a different script that has a different value than what it appears to be.
Or:
qr/(*sr: \b \w+ \b )/x
makes sure that all the characters come from the same script.
You can also combine script runs with (?>...)
(or *atomic:...)
).
Instead of writing:
(*sr:(?<...))
you can now run:
(*asr:...)
# or
(*atomic_script_run:...)
This is considered experimental, so using it will raise (unless turned off) a warning in the experimental::script_run
category.
The new string-specific (&. |. ^. ~.
) and number-specific (& | ^ ~
) bitwise operators introduced in Perl 5.22 that are available within the scope of use feature 'bitwise'
are no longer experimental. Because the number-specific ops are spelled the same way as the existing operators that choose their behaviour based on their operands, these operators must still be enabled via the "bitwise" feature, in either of these two ways:
use feature "bitwise";
use v5.28; # "bitwise" now included
They are also now enabled by the -E command-line switch.
The "bitwise" feature no longer emits a warning. Existing code that disables the "experimental::bitwise" warning category that the feature previously used will continue to work.
One caveat that module authors ought to be aware of is that the numeric operators now pass a fifth TRUE argument to overload methods. Any methods that check the number of operands may croak if they do not expect so many. XS authors in particular should be aware that this:
SV *
bitop_handler (lobj, robj, swap)
may need to be changed to this:
SV *
bitop_handler (lobj, robj, swap, ...)
Compiling certain regular expression patterns with the case-insensitive modifier could cause a heap buffer overflow and crash perl. This has now been fixed. [perl #131582]
For certain types of syntax error in a regular expression pattern, the error message could either contain the contents of a random, possibly large, chunk of memory, or could crash perl. This has now been fixed. [perl #131598]
$ENV{$key}
stack buffer overflow on WindowsA possible stack buffer overflow in the %ENV
code on Windows has been fixed by removing the buffer completely since it was superfluous anyway. [perl #131665]
perl 5.27.5 started allowing unsigned long/4 stack indices for its sv arguments, and width and precision with the API even allowing unsigned long
. Previously those numbers were safely typed to int
. Revert that security problem in cperl. The maximal width and precision is also back to INT_MAX. See [cperl #344]
E.g. <$fh\000>
throws now the safe syscalls warning, and errors with Glob not terminated
, and does not pass the illegal glob path to the internal or external glob.
This problem was added with v5.27.5 by replacing strchr with memchr, allowing such illegal strings. See [cperl #342] cperl-only.
Fixed two security issues with the chroot op:
1. fail on embedded NUL in the chroot argument. Set errno
to EINVAL.
2. If a call to chroot is not followed by a call to chdir("/") the chroot jail confinement can be violated. In Perl_pp_chroot: A call to chroot followed by an operation that may escape from the chroot jail. Coverity CID #165302 Insecure chroot.
POSIX 2008 demands such an umask, but it is still problematic on Solaris, HP-UX and AIX and older libcs, e.g. glibc <= 2.06. Temporarily set the umask such that the temp. file has 0600 permissions.
perl5 still claims to have improved hash table security by switching to mostly "secure" hash functions: Siphash (2-4 and 1-3 variants), Zaphod32, and StadtX hash. In addition they support SBOX32 (a form of tabular hashing) for hashing short strings, in conjunction with any of the other hash functions provided.
This is a false claim and pure security theatre. Hash tables cannot be made secure by switching to slower but still insecure hash functions. Only hash function with more than 256 bits can be considered secure All 32bit hash functions can be trivially brute-forced (in up to max 4min for the slowest) once you know the secret seed, which is easily exposed in perl5. Hash table security can only be done via a secure collision strategy. Hash table hash functions must be small and fast.
See also cperl hash tables and The dangerous SipHash myth
use strict
now includes a hashpair enforcement; this will now fail:
my %xsc = map { /(.*)\.xs$/ ? ("$1.c" => 1, "$1.cc" => 1) : () } @files;
Two pairs being added in a map block violates strict hashpairs. Add the second pair in a second loop or assign to an array and then to an hash or add no strict 'hashpairs'
.
my %xsc = map { /(.*)\.xs$/ && ("$1.c" => 1) } @files;
/^(.*)\.xs$/) && $xsc{"$1.cc"} = 1 for @files;
or
my @xsc = map { /(.*)\.xs$/ ? ("$1.c" => 1, "$1.cc" => 1) : () } @files;
my %xsc = @xsc;
or
my %xsc;
{
no strict 'hashpairs';
%xsc = map { /(.*)\.xs$/ && ("$1.c" => 1) } @files;
/^(.*)\.xs$/) && $xsc{"$1.cc"} = 1 for @files;
}
cperl-only.
Omitting the commas between variables passed to formats is no longer allowed. This has been deprecated since perl 5.000.
:locked
and :unique
attributes have been removedThese have been no-ops and deprecated since perl 5.12 and 5.10, respectively.
\N{}
with nothing between the braces is now illegal.This has been deprecated since Perl 5.24.
Using open() and opendir() to associate both a filehandle and a dirhandle to the same symbol (glob or scalar) has been deprecated since Perl 5.10.
<<
to mean <<""
is no longer allowedUse of a bare terminator has been deprecated since Perl 5.000.
This used to work like setting it to undef
, but has been deprecated since Perl 5.20.
IV_MAX
are now fatal.This was deprecated since Perl 5.24.
B::OP::terse
no longer exists.Use B::Concise::b_terse
instead.
This was deprecated in Perl 5.004.
Code points over 0xFF do not make sense for bitwise operators.
Previously the -S
switch incorrectly treated backslash ("\") as an escape for colon when traversing the PATH
environment variable. [perl #129183]
Perl 5.22.0 introduced an optimization allowing subroutines to be stored in packages as simple sub refs, not requiring a full typeglob (thus potentially saving large amounts of memeory). However, the optimization was flawed: it only applied to the main package.
This optimization has now been extended to all packages. This may break compatibility with introspection code that looks inside stashes and expects everything in them to be a typeglob.
When this optimization happens, the typeglob still notionally exists, so accessing it will cause the stash entry to be upgraded to a typeglob. The optimization does not apply to XSUBs or exported subroutines, and calling a method will undo it, since method calls cache things in typeglobs.
perl5.27.6 restricted ...
, the yada-yada operator, to be a statement only. cperl reserved ...
for the ellipsis, i.e. unassigned varargs in signatures to be passed through. Which is not a statement, but a term. In cperl ...
is a TERM. Before ...
was parsed as an operator, also used for ranges.
This affects illegal code like:
... . "foo";
... if $a < $b;
do{...}
cperl-only.
Embedded NUL bytes read from files, not used in filters, are not whitespace anymore, they are syntax errors.
See [cperl #345] vs [perl #105920].
Parsing NUL bytes is now consistent from files with eval string. \0
delimited q
quote is still valid though.
The B module does not export the class method anymore. You need to use the full B::class
name to avoid confusion with the new class keyword. cperl-only.
Since Perl 5.8, the sort pragma has had subpragmata _mergesort
, _quicksort
, and _qsort
that can be used to specify which algorithm perl should use to implement the sort builtin. This was always considered a dubious feature that might not last, hence the underscore spellings, and they were documented as not being portable beyond Perl 5.8. These subpragmata have now been deleted, and any attempt to use them is an error. The sort pragma otherwise remains, and the algorithm-neutral stable
subpragma can be used to control sorting behaviour. [perl #119635]
Octal and binary floating point literals used to permit any hexadecimal digit to appear after the radix point. The digits are now restricted to those appropriate for the radix, as digits before the radix point always were.
unpackstring()
The return types of the C API functions unpackstring()
and unpack_str()
have changed from I32
to SSize_t
, in order to accommodate datasets of more than two billion items.
vec
on strings with code points above 0xFF is deprecated.Use of these is nonsensical, as vec
is a bit-oriented operation, which operates on the underlying UTF-8 representation these strings must be in, and will likely give unexpected results.
"{"
are no longer fatalPerl 5.26.0 fatalized some uses of an unescaped left brace, but an exception was made at the last minute, specifically crafted to be a minimal change to allow GNU Autoconf to work. This code is heavily depended upon, and continues to use the deprecated usage. Its use of an unescaped left brace is one where we have no intention of repurposing "{"
to be something other than itself.
That exception is now generalized to include various other such cases where the "{"
will not be repurposed. This is to get real experience with this more complicated change now, in case we need to issue a dot release if we find other things like Autoconf that are important to work around.
Note that these uses continue to raise a deprecation message.
"{"
immediately after a "("
in regular expression patterns is deprecatedUsing unescaped left braces is officially deprecated everywhere, but it is not enforced in contexts where their use does not interfere with expected extensions to the language. A deprecation is added in this release when the brace appears immediately after an opening parenthesis. Before this, even if the brace was part of a legal quantifier, it was not interpreted as such, but as the literal characters, unlike other quantifiers that follow a "("
which are considered errors. Now, their use will raise a deprecation message, unless turned off.
$[
will be fatal in Perl 5.30Assigning a non-zero value to $[
has been deprecated since Perl 5.12, but was never given a deadline for removal. This has now been scheduled for Perl 5.30.
Passing arguments to Sys::Hostname::hostname()
was already deprecated, but didn't have a removal date. This has now been scheduled for Perl 5.32. [perl #124349]
This is a new syntax warning, which is deprecated, and will disappear with v5.30c. Hash slices and key/value hash slices autovivified in subroutine arguments. This was a bug, but to check all your code for correctness and portability we keep this warning for 2 releases. See [cperl #347] and "No autovivification of hash slice anymore" in perldiag. cperl-only.
The following modules will be removed from the core distribution in a future release, and will at that time need to be installed from CPAN. Distributions on CPAN which require these modules will need to list them as prerequisites.
The core versions of these modules will now issue "deprecated"
-category warnings to alert you to this fact. To silence these deprecation warnings, install the modules in question from CPAN.
Note that these are (with rare exceptions) fine modules that you are encouraged to continue to use. Their disinclusion from core primarily hinges on their necessity to bootstrapping a fully functional, CPAN-capable Perl installation, not usually on concerns over their design.
was removed with 5.28 in perl and cperl.
will be removed from core with 5.30, and needs to be installed from CPAN then. Best together with B::Flags.
is marked as deprecated and obsolete.
The start up overhead for creating regular expression patterns for /i case-folding and with Unicode properties (\p{...}
) has been greatly reduced in most cases.
On hash split and shrink the rounding up to a power of 2 has been improved by a factor of 10^8 on modern hardware (that's 8 zeros: 100000000). On old hardware by a factor of 2. cperl-only.
Replaced the old quadratic bsd glob with a linear glob, detected by Russ Cox https://research.swtch.com/glob.
XS calls and static method calls were made faster again. Previously cperl (with 5.22.1c) fell from pure perl calls to XS calls and changed the call type to ENTERXSSUB for faster subsequent invocations. This made bigger examples ~10% faster. Now the compiler detects calls to XS code and changes the type to ENTERXSSUB. Also the method cache code checks now for an XS call and changes the type of the next OP. Overall the improvement is ~3.5%, but it depends on the frequency of XS calls. It's 0.5-1% slower without any XS call. Note that p5p decided to delete this feature request from it's TODO list.
All static method calls are now optimized to function calls at compile-time.
Before:
$ cperl5.27.0d-nt -Dt -e'use strict'
(-e:1) nextstate
(-e:1) const(PV("strict.pm"))
(-e:1) require
(-e:1) nextstate
(-e:1) pushmark
(-e:1) const(PV("strict"))
(-e:1) method_named(->import)
(-e:1) entersub(strict::import)
(-e:1) enterxssub(strict::import)
(-e:1) leavesub
v5.27.1c:
$ cperl5.27.1d-nt -Dt -e'use strict'
(-e:1) nextstate
(-e:1) const(PV("strict.pm"))
(-e:1) require
(-e:1) nextstate
(-e:1) pushmark
(-e:1) const(PV("strict"))
(-e:1) method_named(->import)
(-e:1) enterxssub(strict::import)
(-e:1) leavesub
v5.27.2c:
$ cperl5.27.2d-nt -Dt -e'use strict'
(-e:1) nextstate
(-e:1) const(PV("strict.pm"))
(-e:1) require
(-e:1) nextstate
(-e:1) pushmark
(-e:1) const(PV("strict"))
(-e:1) gv(strict::import)
(-e:1) enterxssub(strict::import)
(-e:1) leavesub
See http://blogs.perl.org/users/rurban/2011/06/how-perl-calls-subs-and-methods.html
We don't yet optimize typed scalars to a static call. We don't walk the subtypes yet to find the method. The remaining const(PV("strict"))
op looks superfluous also, as the package is already resolved at compile-time. cperl-only.
Most checks for readonly packages are now avoided, needed to bypass the "Attempt to access disallowed key %s in the restricted hash %CLASS::" errors. Stash lookup now got a GV_CLASS flag and hv_fetch*_ifexists
macros, which does the EXISTS and FETCH hash actions in the stash on one. cperl-only.
Optimized the loop ITER ops to jump directly to the subsequent AND op. For an empty body, this cuts about 20% off the time of an iteration. Backported from perl-5.27.3. This is a simplier implementation of the cperl feature/gh138-iter-and branch from [cperl #138].
Thus inner loops are now smaller and faster: 15%-50%.
e.g. before:
f <{> enteriter(next->q last->t redo->g) KS/DEF
r <0> iter_ary s
s <|> and(other->g) K/1
g <;> nextstate(main 559 (eval 15):1) v:{
h <$> gvsv(*_) s
Now:
f <{> enteriter(next->q last->s redo->g) KS/DEF
r <|> iter_ary(other->g) sK
g <;> nextstate(main 559 (eval 15):1) v:{
h <$> gvsv(*_) s
cperl-only, [cperl #138]. Upstream 5.27 improved also a bit by skipping the AND op at run-time. cperl removed it from the optree at compile-time.
The fields API refactor using a local "HvFIELDS" in perlapi buffer and not globals %FIELDS
and @FIELDS
SVs anymore gained 25% speed and similar memory improvements. cperl-only.
Optimize field method calls to faster oelemfast OPs, accessing the field directly. cperl-only.
Removed PL_sv_count
variable and updates on every new_SV
and del_SV
on non-DEBUGGING builds. For refcount leak checks scan the arenas. cperl-only.
SvTRUE()
is now more efficient.
The ref()
builtin is now much faster in boolean context, since it no longer bothers to construct a temporary string like Foo=ARRAY(0x134af48)
.
keys()
in void and scalar contexts is now more efficient.
Various integer-returning ops are now more efficient in scalar/boolean context.
The common idiom of comparing the result of index() with -1 is now specifically optimised, e.g.
if (index(...) != -1) { ... }
Slightly improved performance when parsing stash names. [perl #129990]
cperl added the optimization to skip expanding '
to ::
. The '
as valid perl4-style package seperator was removed. In XS you can check for the define PERL_NO_QUOTE_PKGSEPERATOR if the quote as package seperator is disallowed. '
is now a valid part of a subroutine name.
Calls to require
for an already loaded module are now slightly faster. [perl #132171]
Many string concatenation expressions are now considerably faster, due to the introduction internally of a multiconcat
opcode which combines multiple concatenations, and optionally a =
or .=
, into a single action. For example, apart from retrieving $s
, $a
and $b
, this whole expression is now handled as a single op:
$s .= "a=$a b=$b\n"
As a special case, if the LHS of an assign is a lexical variable or my $s
, the op itself handles retrieving the lexical variable, which is faster.
In general, the more the expression includes a mix of constant strings and variable expressions, the longer the expression, and the more it mixes together non-utf8 and utf8 strings, the more marked the performance improvement. For example on a x86_64
system, this code has been benchmarked running four times faster:
my $s;
my $a = "ab\x{100}cde";
my $b = "fghij";
my $c = "\x{101}klmn";
for my $i (1..10_000_000) {
$s = "\x{100}wxyz";
$s .= "foo=$a bar=$b baz=$c";
}
In addition, sprintf
expressions which have a constant format containing only %s
and %%
format elements, and which have a fixed number of arguments, are now also optimised into a multiconcat
op.
This is not yet supported by the B::C compiler modules.
Subroutines in packages no longer need to be stored in typeglobs, saving large amounts of memory. See "Subroutines no longer need typeglobs" under "Incompatible Changes", above.
The performance of pattern matching [[:ascii:]]
and [[:^ascii:]]
has been improved significantly except on EBCDIC platforms.
Various optimizations have been applied to matching regular expression patterns, so under the right circumstances, significant performance gains may be noticed. But in an application with many varied patterns, little overall improvement likely will be seen.
Other optimizations have been applied to UTF-8 handling, but these are not typically a major factor in most applications.
Key highlights in this release across several modules:
The usage of use vars
has been discouraged since the introduction of our
in Perl 5.6.0. Where possible the usage of this pragma has now been removed from the Perl source code.
This had a slight effect (for the better) on the output of WARNING_BITS
in B::Deparse.
Several core modules released on CPAN will not work anymore with perl versions prior to 5.6.
XSLoader is more modern, and most modules already require perl 5.6 or greater, so no functionality is lost by switching. In some cases, we have also made changes to the local implementation that may not be reflected in the version on CPAN due to a desire to maintain more backwards compatibility.
Note that XSLoader is just an convenience extension over DynaLoader, for pure speed or less codesize DynaLoader is still the best solution.
For now only the new
, CREATE
and fields
methods, implemented as XS builtins.
Just the documentation for the perl6 MOP.
'0' is a valid name for an archive, change 'iter' to check definedness. See https://metacpan.org/changes/distribution/Archive-Tar
Fix creating file with trailing whitespace on filename - fixes 103279
Allow archiving with absolute pathnames - fixes 97748
Small POD fix
Speed up extract when archive contains lots of files
CVE-2018-12015 directory traversal vulnerability [cpan #125523]
Remove #ifdef USE_ITHREADS around MUTEX_* calls
Remove deprecated no-op attributes :unique, :locked. Added another param to validate_proto.
Fixed :const parsing with SVs (cperl-only). Previously :const would set the containing sub to :const, now it sets the lexical to readonly, with deferring the attributes::import call after an assignment.
my %h :const = (a => 1);
=>
assign %h = (...);
attributes->import(PACKAGE, \%h, const);
See [cperl #294].
Remove deprecated no-op attributes :unique, :locked
Fix autovivification bug with hash slice args to a function.
Support PL_sv_zero
Add non-destructive $cv->PUREGV method, which does not create a GV from a CvNAMED $cv. Warning: $cv->GV does create a GV from a CvNAMED $cv.
Internal Refactor: thread API
Add many missing methods and docs. Some from B::C.
Don't export class anymore.
Support pgcc, seperate it from gcc
One global dJMPENV target, not multiple. Esp. for B::CC.
ByteLoader 0.12 fix bytecode types, xgv_flags, xcv_flag were too small. type bs_sv to also include PADNAME, PADLIST, PADNAMELIST as union.
Add t/testc.sh
Fix compile-time REGEXP
Protect from destructive $cv->GV, renamed is_lexsub to is_named, allow @0, &0, ... types.
Support POK/PVLV REGEXP for v5.27.3/v5.27.2c
VOL => volatile for v5.27.6/v5.27.2c
Warning: The new multiconcat op is not yet supported.
Support the new strict hints flags and abbrevate all strict flags as strict.
Support PL_sv_zero
Support boolean optims.
Better constant-dumping heuristics.
Many other bug fixes, and in particular, it now deparses variable attributes correctly:
my $x :foo; # used to deparse as
# 'attributes'->import('main', \$x, 'foo'), my $x;
Remove internal links to B::Debug
Support sub refs, and named anon subs.
Turn off HvCLASS again, just turn on SvREADONLY @ISA
. With all the new class features, we cannot and should not compete.
The problem is the new sub as :method warning with classes, which would cause all Test::Simple methods to be declared as :method, as they derive from base.
Limit dotless-INC effect on base.pm with guard
merge with upstream
The perl5.28 Carp 1.49 update broke the B::C compiler by compile-time references to too many packages for no apparent reason: warnings, overloading, overload, UNIVERSAL::isa. Even the simpliest scripts could not be compiled anymore.
We rather suggest fixing the broken code by checking the warnings, as in the changed tests. The infinite recursion bug in t/Carp_overloadless.t is handled by use warnings FATAL => 'recursion' in the test, and your code should also.
The t/rt52610_crash.t with refcounted stack corruption is handled by eval wrapping in the test as your code should also.
The next Carp written in XS will not have these limitations, but a PP Carp should not overdo it. backtraces in critical error cases should be stable and perform no additional unstable dynamic loading.
Fix problems introduced by the partial EBCDIC support from version 1.35, and ISA constants. Not all stash elements are globs.
charnames
1.45Remove obsolete pod about NBSP
Support pgcc, seperate it from gcc
Support pgcc, seperate it from gcc
Updated internal zlib from 1.2.8 to latest, past 1.2.11
Silence gcc compiler warnings when -Wsign-compare is enabled #123688: Compilation warnings with clang
Silence gcc compiler warnings when -Wimplicit-fallthrough is enabled #123358: Compilation warnings with gcc-7.*
Windows uses -lzlib. Linux uses -lz #123699: wrong external zlib name used on Windows
Update zlib-src directory to use zlib 1.2.11 #123245: perl 5.26.1 is vulnerable to CVE-2016-9843, CVE-2016-9841, CVE-2016-9840, CVE-2016-9842
Don't allow offset to be greater than length of buffer in crc32.
Change my_zcalloc to use safecalloc. https://github.com/madler/zlib/issues/253 is the upstream report for the remaining valgrind errors not already dealt with by 1.2.11. Using calloc in Zlib.xs for now as a workaround. #121074: valgrind errors in the test suite
Fixed upstream deflate. See https://github.com/madler/zlib/pull/327 1.2.11 is not recommended to use.
Add test for 5.26.1-RC1, and some cperl -V's
Fix signature with argument
Ignore ccache and compiler path in signature
Add default_inc_excludes_dot
use vars => our
constant
1.34coretypes
0.03cEach coretype is now a class.
MSVC 14.0 support and higher, changed nan in the runtime.
Stringify true again as "1".
Disallow duplicate keys by default, only allow them in relaxed mode.
De-fragilize t/96_mojo.t false test to "". It mostly is.
Fix and unify utf8 handling with 5.6.2 and improve many utf8 tests.
Add tests for boolean sv_yes and sv_no.
Check for correct module in %INC.
Relax inf/nan detection for newer msvcrt.dll runtime versions (it's now almost ANSI).
Fixed locale-insensitive numeric conversion on older perls. Fixed compilation under windows.
Simplify allow_singlequote
check, coverity cid #165321. Remove logical dead code.
Added Cpanel::JSON::XS::Type as 2nd optional encode argument.
Removed calling get magic hooks twice in encode.
Fix setlocale thread race for older perls.
Fix overloaded eq/ne comparisons (GH #116 by demerphq, GH #117 by Graham Knopp): detect strings, protect from endless recursion. false is now ne "True". clarify eq/ne rules in the docs.
Set decoded type (PR #115 by Pali)
Add json_type_weaken (PR #114 by Pali)
Fix tests for 5.6 (rurban, pali)
Add sereal cpanel_json_xs type (#110 James Rouzier)
Improved bencode/bdecode methods in cpanel_json_xs (#111 Fulvio Scapin)
Add encoder indent_length method (#103 rouzier), previously hard-coded to 3.
Fix centos7 locale crash (#101 McA), fix required for all threaded perl's < 5.22 with glibc.
Fix uselocale() code. Probe for uselocale and xlocale.h with <5.22 threaded.
Avoid setlocale race in threads with non-C locales, where the threads differ in the LC_NUMERIC locale. (#99 pali)
Attempt to work around XS deparse issues on old perls.
XS improvements
Quoting of glob names now obeys the Useqq option [perl #119831].
Attempts to set an option to undef
through a combined getter/setter method are no longer mistaken for getter calls [perl #113090].
Add TYPECHECKED, RETTYPE and pad var names and types.
Dump the values of a COP $^H, %^H and lexical warnings. Improved the test a bit.
Use cv_set_call_checker_flags
Restore silence under make -s
. I broke it in cperl 5.27.0
Add #if { CPERL && VERSION
5.26.0 }> support, support parser enum expectation.
mkppport called PPPort_pm.PL without passing through MAKEFLAGS. Add --quiet support there
Fix WIDEST_UTYPE.
Support strict hashpairs, fix for . in @INC.
Merge with upstream, changed croak/mess/warn_nocontext/..., add NEED_ macros ...
Add pod synopsis for modules for older perls.
Remove deprecated -p option and PurePerl variant.
Replaced DynaLoader with XSLoader.
Silenced compiler warnings from VS2017 RT #124477
Modified addfile to return error when given a directory name, makes behavior consistent with GNU coreutils shaXsum.
Document as obsolete
Document the MacOS build failures & how MacPort can work around the issue. #125238, #125585, RT#133280
Write all test db files into a directory created by File::Temp Protects against any possible races if running a parallel build.
#96357: DB_File destructor is not thread-safe Added CLONE_SKIP to DB_File.pm and included the test db-threads.t from the patch.
#124944 allow ppport.h-less builds in core
Fix wrong usage of SvREFCNT_inc_simple_NN
with a function, fixes a memory leak.
no strict hashpairs in encoding. fixed some -Wsign-compare See https://metacpan.org/changes/distribution/Encode
Skip the flapping test t/Aliases.t on threaded smokers, with random segfaults. This is a long standing core bug, with PMOP aliases or clone. First observed at https://github.com/rurban/perl-compiler/issues/73 (since 5.6)
Stop directory tweaking $Encode::Encoding{utf8}
Fix gcc warnings for older gcc < 4.0
Where possible do not depend on value of $@, instead use return value of eval
Fix more XS problems in Encode.xs file
Load modules Encode::MIME::Name and Storable normally
Remove no warnings 'redefine'; and correctly loaddependences
Remove PP stubs and reformat predefine_encodings()
Run Encode XS BOOT code at compile time
Use Encode::define_encoding and propagate carp/croak message
cperl fixes: encoding undeprecated, no strict hashpairs
Cleanup code for handling fallback/replacement characters
lib/Encode/MIME/Name.pm t/mime-name.t Pulled: Add "euc-cn" => "EUC-CN" alias to Encode::MIME::Name https://github.com/dankogai/p5-encode/pull/124
lib/Encode/CN/HZ.pm lib/Encode/JP/JIS7.pm lib/Encode/MIME/Header.pm t/decode.t Pulled: Uninitialized value fixes #122 https://github.com/dankogai/p5-encode/pull/122
Makefile.PL Pulled: Fix -Werror=declaration-after-statement for gcc 4.1.2 https://github.com/dankogai/p5-encode/pull/121
Fixed deep recursion in Encode::find_encoding when decoding.
eval use feature, minor test fix. Add the declared_refs feature. Enable lexical_topic for cperl 5.24, added perl5 compat.
More use vars => our
Fix C++ compiler detection (RT #131749)
Minor updates from p5p, but they are still distributing a broken module, bumping their version higher than ours. And worse, their version creates broken CPAN modules.
Fix tests for when perl path contains a space
Fix win32 check
'make -s' support: set $INSTALL_QUIET automatically
Optimisations:
* use our instead of vars
* lazy load modules
* make OS variables into constants
* move some calculations out of a loop
Removed instructions using Build.PL from README
Load Win32API::File for _move_file_at_boot only when needed
Allow disabling autosplit by omitting autosplit dir
Merge our fixes to upstream 7.35_06 (which has e.g. the dlltool mingw and parallel MSVC fixes). Many fixes were already in, but some new upstream bugs crept in.
Support IO::Scalar handle as $parsefile argument to ExtUtils::MM_Unix::parse_version().
fix Invalid Locale symbol name. Invalid identifier "ENCODING_UTF-8" while "strict names"
fix XSMULTI static with strict linkers, avoid duplicate symbol _boot_XS__Test in: Test.o blib/arch/auto/XS/Test/Test.a(Test.o)
xsstatic: fixup MAKE_APERL_FILE, which was Makefile.aperl.aperl, add xs_static_lib_is_xs
MSVC: seperate dbgoutflag
VMS: add static_lib_pure_cmd
Liblist: support libdirs with spaces
Support afl-fuzz with afl-clang-fast
Skip PUTBACK;return;
on XSRETURN in PPCODE
Remove perl5 incompatible __attribute__global__
needed for -flto. XS_EXTERNAL
has it already.
Moved xs pods still missing from the CPAN release completely to core.
A cperl class has now fields with @class::FIELDS
targ offsets to the lexical fields, and the old %type::FIELDS
hash pointing to the *class
GV, allowing again compile-time type checks on typed object hash accesses.
Implemented "fields" in Mu returning fields objects, as in perl6 (there called Attributes).
Revert the conversion of a fields package to class. Only close the ISA as with base.
cperl-only.
It will now use the sub-second precision variant of utime()
supplied by Time::HiRes where available. [perl #132401].
Switch test URL from www.cpan.org to httpbin.org
Skip a test when File::Glob not used. Avoid undefined behaviour in Copy() [perl #131746]
Remove erroneous documentation.
Correct skip count for Windows.
Comment out two TODO tests.
Make subdirectory names used in tests more random.
Bumped version from unparsable 3.3.65, which prevented e.g. File::chdir to install.
Various small documentation fixes. Swap out base.pm use for parent.pm. Remove use of deprecated \C regex feature. Filter::Simple was erroneously signalling eof if it encountered a ‘no MyFilter’ right after ‘use’: use MyFilter; no MyFilter; In this case it should simply not filter anything.
- remove File::Temp::Dir from the PAUSE index (it is not in its own .pm file, so it is not 'use'able on its own)
- change EXLOCK default from true to false; addresses RT#123959. Note that this option was always a no-op on non-BSD platforms; changing the default to false makes behaviour more predictable and consistent across platforms.
- switch from 'use vars' to 'our'
- documentation updates for what versions contain what features (thanks, Brian Mowrey! RT#101518)
- fix bad use of skip() in tests (RT#95922)
- Fall back to CSIDL_LOCAL_APPDATA under taint on Windows (RT#60340)
- update distribution tooling
XSLoader, our. defer Carp.
Add filter_read_exact tests.
Improve tests using FindBin for filter-util.pl [atoomic #9]
Add int casts, assert on 2GB limitation.
Its documentation now explains that each
and delete
don't mix in hashes tied to this module [perl #117449].
It will now retry opening with an acceptable block size if asking gdbm to default the block size failed [perl #119623].
Fix bug https://rt.cpan.org/Ticket/Display.html?id=120231.
Fix bug https://rt.cpan.org/Ticket/Display.html?id=120300. Unfortunately, this withdraws a small part of fix 114999. GNU getopt_long()
does not accept the (optional) argument to be passed to the option without =
sign. We do, since not doing so breaks existing scripts.
Provide a default value for options (gnu_compat mode). Thanks to Andrew Gregory.
XS formatting
Fix new autovivified hash slice warning, usenamedanoncv in api test
Use the new core function Perl_langinfo()
.
This module is now available on all platforms, emulating the system nl_langinfo(3) on systems that lack it. Some caveats apply, as detailed in its documentation, the most severe being that, except for MS Windows, the CODESET
item is not implemented on those systems, always returning ""
.
It now sets the UTF-8 flag in its returned scalar if the string contains legal non-ASCII UTF-8, and the locale is UTF-8 [perl #127288].
This update also fixes a bug in which the underlying locale was ignored for the RADIXCHAR
(always was returned as a dot) and the THOUSEP
(always empty). Now the locale-appropriate values are returned.
Linkify docs.
Doc how to import when you want to use MODULE ()
replace use vars with our, run-time load Carp, Bump versions of 3 Socket modules. Remove 5.6 support
lots of whitespace fixes in zipdetails exclude t/999pod.t also
Fix new Autovivified hash slice warning
Added wait_loop_callback
for run_forked()
Only search in curdir in can_run(
) when on Win32 RT #105601
Fixed can't use IPC::Cmd->run_forked in the first process of a container RT #118424
Fixed run_forked("/usr/bin/echo test") captures no output RT #91784
HPUX test fixes.
Various, see https://metacpan.org/changes/distribution/JSON-PP Merged 2.97001 from cpan with ours. Minor updates, mostly docs. Upstream Boolean still did not work with Cpanel::JSON::XS.
libnet
3.11_01Fixup the new pairmap spill code.
Deprecated from core, moved to cpan.
now up-to-date with upstream
Fix problem with second operand being changed in multiplication RT #121139
cperl: Keep omitting Carp imports. Keep t/bigroot.t and t/biglog.t
Skip flapping, timer-sensitive t/expmod_t.t tests on Travis CI.
Improve CPANPLUS: Fix [cperl #331], checking for cperl builtins. With a slightly adjusted patch from @voegelas.
Suppress new Autovivified hash slice warning
prevent mro.pm from loading DynaLoader
formatting, cperl enhancements
Implemented "fields" in Mu returning fields objects. cperl-only.
Fix ping_udp for a started udp echo server (PR#5 by Stephan Loyd)
Fix t/400_ping_syn.t phases
Try to handle Windows Socket::getnameinfo errors
Improve some tests on missing network connections
Keep v5.002 - v5.6 support
Removed outdated demo/fping from the documentation (RT #123750 by Steve Morris)
Added t/420_ping_syn_port.t (#4 by Julio Fraire) with fixes.
Added indices and crosslinks to the documentation
use NIx_NOSERV flag for windows.
better icmpv6 support.
Fix for GLOB stubs [cpan #123002].
Improve error message for bogus -MO=… arguments
Added new 'oelem' and 'oelemfast' to :base_core
use vars => our.
Add security usage note to File::Spec::no_upwards white space change so can compile under C++11 Protect modules also from . in @INC [perl #127384] (CVE-2016-1238)
getcwd, getdcwd and abs_path have now long path support. getdcwd (Windows only) also supports unicode paths, using the wide API.
check invariant at compile time.
return EACCES on writing to a read-only scalar
Protect from NULL arg.
Support debugger cmds not requiring spaces
no strict hashpairs
Various upstream changes, see https://metacpan.org/changes/distribution/podlators
A title for the HTML document will now be automatically generated by default from a "NAME" section in the POD document, as it used to be before the module was rewritten to use Pod::Simple::XHTML to do the core of its job [perl #110520].
customize to fix formatters and pager misbehaviour
Man page references and function names now follow the Linux man page formatting standards, instead of the Solaris standard.
getcwd has now long path support.
Added realpath, with long path support, if the libc supports NULL as 2nd argument.
Some more cautions were added about using locale-specific functions in threaded applications.
Faster. add DEBUGGING_RE_ONLY define
fix find_rundefsvoffset logic
Fix t/subname.t and t/exotic_names.t for unstrict names. perl5.26 started defining $Config{usecperl} as 'UNKNOWN', hence this check is now unreliable.
Merge with 1.50 upstream: Ensure pairmap extends its stack correctly (davem) Fix name of List::Util::unpairs in its error messages
added head/tail honor PERL_NO_QUOTE_PKGSEPERATOR merged %DB::sub tests merge with upstream %DB::sub support (main:: or not, utf8)
Bump version
Bump version
no sort stable; SORTf_UNSTABLE flag
perl5 merged with us, with some minor internal architectural changes.
mingw fix: use safe defaults, not segfaulting defaults. mingw fails on the stacksize binary search, leaving it empty.
Try to fix readonly stacksize.h with perlbrew. [cperl #335]
Fix t/blessed.t for 5.10/5.12 threaded.
Restore max stacksizes for non-windows systems with proper system(SHELLSTRING) passing signals. Unify stack reserve to 32 across all platforms.
Dont build dynamic with a static perl
Added use strict 'hashpairs'
to allow only pairs for hash assignments, within a map even only an empty or single pair. See [cperl #281. cperl-only
Added strict 'names'
to reject illegal identifiers created via no strict 'refs'
also at run-time, not only at compile-time. See [cperl #282]. cperl-only
Improved Symbol::delete_package for readonly and protected symbols and classes. cperl-only
Protect from fileno returning -1, invalid file arg. Reformatted.
fix for empty &STDERR files, RT #132008
Enable rulesfile.t to run in core
Return handle for pipes and sockets #58 (Erik Huelsmann) TAP v13 plan allows trailing whitespace (Steffen Schwigon) prove: add a --statefile=<path> option to customize the .prove file (Ævar Arnfjörð Bjarmason) Avoid non-deterministic source handling, make a SourceHandler tie an error. (Michael Schwern, Leon Timmermans) Fix and simplify MSWin32 colorization (Roy Ivy III) Fix file source handler to accept single extensions option (Tomoki Aonuma) Spelling fixes (Brian Wightman)
[RT #125868] Fix tests for Test::Simple 1.302138
Fix Clang macro backward compatibility per patch by Andy Grundman. Keep the old better doc. Keep our modglobal fix in global destruction from 2.12_01.
Support PL_sv_zero. Don't Copy() null pointer
The documentation now better describes the problems that arise when returning values from threads, and no longer warns about creating threads in BEGIN
blocks. [perl #96538]
Fix Clang macro backward compatibility per patch by Andy Grundman. RT #131124 Memory allocation fix.
use croak_no_modify_sv()
Updated from upstream since 1.9744:
See https://metacpan.org/changes/distribution/Time-HiRes
fix MSVC by adding a fake struct timezone.
add more potential clock constants, like CLOCK_MONOTONIC_FAST (available in FreeBSD), and not all potentially found clock constants were properly exported to be available from Perl, see your system's clock_gettime() documentation for the available ones
correct declared minimum Perl version (should be 5.6, was declared as 5.8 since 1.9727_03): blead af94b3ac
merged with our cperl test fixes. See https://github.com/rurban/Time-HiRes/commits/cperl
Drop 5.005 support. Replace DynaLoader with XSLoader.
Some tests which required support for epoch values larger than 2**32 were not being skipped when the underlying Perl did not support that.
Fixed the tests so they will not break in the year 2020. The tests were passing in 2-digit years on the assumption that a year like "70" would be treated as 1970, but starting in 2020 this would be treated as 2070 instead. Reported by Bernhard M. Wiedemann. RT #124787.
Added timelocal_modern and timegm_modern variants as optional exports. These versions do not munge years at all. They treat the year value that they are given exactly as-is.
Switch to XSLoader.
Fix AIX compile
Fix compile errors on MS
Use macro for buf sizes
Remove some compile warnings
SP off by 1 in _crt_localtime
Drop 5.005 support. Replace DynaLoader with XSLoader.
Skip redefinition warnings on cperl since 5.27.2
Switch to XSLoader from Dynaloader.
The function num
now accepts an optional parameter to help in diagnosing error returns.
New core invlists/maps not yet used.
Improved function documentation
Add updates from 0.9918: Add LAX_DECIMAL_VERSION, LAX_DOTTED_DECIMAL_VERSION, STRICT_DECIMAL_VERSION, STRICT_DOTTED_DECIMAL_VERSION regexes. Add updates from 0.9921: pod, safer C locale switching. add vpp support for cperl: scmp, c suffix. use vars => our.
Add t/11_taint.t
Drop VMS::stdio compatibility shim
It now includes new functions with names ending in _at_level
, allowing callers to specify the exact call frame. [perl #132468]
Fix xsubpp warnings
Fix wrong usage of SvREFCNT_inc_simple_NN
with a function, fixes a memory leak.
Its documentation now shows the use of __PACKAGE__
, and direct object syntax for example DynaLoader
usage [perl #132247].
B::Debug
1.25Moved to CPAN with cperl only. perl5 will remove it with 5.30.
Locale::Codes
3.55Deprecated with v5.27.2c
VMS::stdio
The VMS::stdio
compatibility shim has been removed.
Modern cperl classes and roles. The new syntax and features.
Notes and best practice for packaging perl5, not yet updated for cperl.
We have attempted to update the documentation to reflect the changes listed in this document.
autodoc.pl now parses pod/perlapio.pod for cross-checking against pod/perlapi.pod
Additionally, the following selected changes have been made:
Added API docs for most hash macros, and many more functions.
The API functions perl_parse()
, perl_run()
, and perl_destruct()
are now documented comprehensively, where previously the only documentation was a reference to the perlembed tutorial.
The API functions newCONSTSUB()
and newCONSTSUB_flags()
are documented much more comprehensively than before.
Completed the documentation of the PerlIO API. Removed wrong missing links from documented PerlIO functions from perlapi. Add all missing functions, and inter-linked them.
Added "What hash operations dominate" in perldtrace and "glob/gv call statistics" in perldtrace sections.
Added new pairwise hash construction limitations to "List value constructors" in perldata and "map EXPR,LIST" in perlfunc.
The section "Truth and Falsehood" in perlsyn has been moved into perldata.
The description of the conditions under which DB::sub()
will be called has been clarified. [perl #131672]
"Variable length lookbehind not implemented in regex m/%s/" in perldiag
This now gives more ideas as to workarounds to the issue that was introduced in Perl 5.18 (but not documented explicitly in its perldelta) for the fact that some Unicode /i
rules cause a few sequences such as
(?<!st)
to be considered variable length, and hence disallowed.
The diagnostic Initialization of state variables in list context currently forbidden
has changed to Initialization of state variables in list currently forbidden
, because list-context initialization of single aggregate state variables is now permitted.
The examples in perlembed have been made more portable in the way they exit, and the example that gets an exit code from the embedded Perl interpreter now gets it from the right place. The examples that pass a constructed argv to Perl now show the mandatory null argv[argc]
.
An example in perlembed used the string value of ERRSV
as a format string when calling croak(). If that string contains format codes such as %s
this could crash the program.
This has been changed to a call to croak_sv().
An alternative could have been to supply a trivial format string:
croak("%s", SvPV_nolen(ERRSV));
or as a special case for ERRSV
simply:
croak(NULL);
Added new pairwise hash construction limitations to "List value constructors" in perldata and "map EXPR,LIST" in perlfunc.
There is now a note that warnings generated by built-in functions are documented in perldiag and warnings. [perl #116080]
A couple of small details in the documentation for the bless
operator have been clarified. [perl #124428]
The description of @INC
hooks in the documentation for require
has been corrected to say that filter subroutines receive a useless first argument. [perl #115754]
The documentation of use
now explains what syntactically qualifies as a version number for its module version checking feature.
The documentation of warn
has been updated to reflect that since Perl 5.14 it has treated complex exception objects in a manner equivalent to die
. [perl #121372]
The documentation of die
and warn
has been revised for clarity.
The documentation of each
has been improved, with a slightly more explicit description of the sharing of iterator state, and with caveats regarding the fragility of while-each loops. [perl #132644]
Clarification to require
was added to explain the differences between
require Foo::Bar;
require "Foo/Bar.pm";
The precise rules for identifying smoke-me
branches are now stated.
The section on reference counting in perlguts has been heavily revised, to describe references in the way a programmer needs to think about them rather than in terms of the physical data structures.
Improve documentation related to UTF-8 multibytes.
Added API docs for most toke.c lexer functions. cperl-only
The internal functions newXS_len_flags()
and newATTRSUB_x()
are now documented.
Add warning about raw ?...?
pattern delimiters.
The documentation about DESTROY
methods has been corrected, updated, and revised, especially in regard to how they interact with exceptions. [perl #122753]
Added the missing operator precedences and documentation for the cperl unicode operators.
The description of the x
operator in perlop has been clarified. [perl #132460]
perlop has been updated to note that qw
's whitespace rules differ from that of split
's in that only ASCII whitespace is used.
The general explanation of operator precedence and associativity has been corrected and clarified. [perl #127391]
The documentation for the \
referencing operator now explains the unusual context that it supplies to its operand. [perl #131061]
Clarifications on metacharacters and character classes
Clarify metacharacters.
Clarify the differences between -M and -m. [perl #131518]
The documentation about set-id scripts has been updated and revised. [perl #74142]
A section about using sudo
to run Perl scripts has been added.
The section "Truth and Falsehood" in perlsyn has been removed from that document, where it didn't belong, and merged into the existing paragraph on the same topic in perldata.
The means to disambiguate between code blocks and hash constructors, already documented in perlref, are now documented in perlsyn too. [perl #130958]
perluniprops has been updated to note that \p{Word}
now includes code points matching the \p{Join_Control}
property. The change to the property was made in Perl 5.18, but not documented until now. There are currently only two code points that match this property U+200C (ZERO WIDTH NON-JOINER) and U+200D (ZERO WIDTH JOINER).
For each binary table or property, the documentation now includes which characters in the range \x00-\xFF
it matches, as well as a list of the first few ranges of code points matched above that.
The entry for $+
in perlvar has been expanded upon to describe handling of multiply-named capturing groups.
Moved from dist/ExtUtils-ParseXS to core pod/, as the upstream CPAN releases do not contain them anymore.
In various places, improve the documentation of the special cases in the condition expression of a while loop, such as implicit defined
and assignment to $_
. [perl #132644]
POSIX has been updated with some more cautions about using locale-specific functions in threaded applications.
The following additions or changes have been made to diagnostic output, including warnings and fatal error messages. For the complete list of diagnostic messages, see perldiag.
Odd number of map elements in hash assignment
Added a new HASH private bit to the mapwhile op when a map is assigned to a hash, to be able to warn once per map on uneven hashmap assignments. See [cperl #281 and strict hashpairs.
Only pair in map hash assignment allowed while "strict hashpairs", got %d elements
Only pairs in hash assignment allowed while "strict hashpairs", got %d elements
With "strict hashpairs" in use, odd numbers of elements are forbidden to be assigned to hashes. Within a map block only a single or empty pair.
Cannot complete in-place edit of %s: %s when an unhandled chdir happens during an in-place edit.
Can't "goto" into a "given" block
(F) A "goto" statement was executed to jump into the middle of a given
block. You can't get there from here. See "goto" in perlfunc.
Can't "goto" into a binary or list expression
Use of goto
to jump into the parameter of a binary or list operator has been prohibited, to prevent crashes and stack corruption. [perl #130936]
You may only enter the first argument of an operator that takes a fixed number of arguments, since this is a case that will not cause stack corruption. [perl #132854]
Missing argument for %n in %s in sprintf is now fatal.
Integer overflow in format string for %s
cperl 5.27.2 added a new limitation of INT_MAX to the max. argument index, width and precision values for printf format strings. The new perl5.27.5 limitation is ULONG_MAX, which is a security risk, see "Unsigned long stack access of printf format arguments".
Too large floating point precision in format string %s for %s
cperl 5.27.2 added a new limitation of 1024 to the max. precision of floating point conversions to strings via sprintf, to seperate it from Integer overflows in overlarge indices, width and precision values.
cperl 5.27.2 added a new limitation of max. 65536 fields per class.
panic: cannot yet adjust field indices when composing role %s::%s into %s %s [cperl #311]"
When copying a method from a role to a class, and the field index from the role method would be different to a field index in the resulting class, the method is not yet fixed up to the new indices. A temp. solution would be to change the ordering of the roles, or to use the $self->field
method syntax in the role method. This should be fixed before 5.28. Currently we can only alias composed role methods and we don't change the ordering of the fields. See [cperl #311]
Invalid field index %d of class %s
The class doesn't have that many fields. cperl only
With loopex ops calling a list, all arguments but the last are ignored. This might be valid for side-effects, but useless on constants. Warn with Useless use of constant in list at %s() This affects next, goto, redo, last, dump.
E.g. with label:{next(1,label)}
1 is ignored.
Reference is not weak in W misc.
Old package separator used in string
(W syntax) You used the old package separator, "'", in a variable named inside a double-quoted string; e.g., "In $name's house"
. This is equivalent to "In $name::s house"
. If you meant the former, put a backslash before the apostrophe ("In $name\'s house"
).
do "%s" failed, '.' is no longer in @INC; did you mean do "./%s"?
Was changed from "do "%s" failed, '.' is no longer in @INC".
"Can't modify non-lvalue subroutine call of &%s" was extended to support methods.
The new message is "Can't modify non-lvalue %s call of %s", with the variants "Can't modify non-lvalue subroutine call of &CLASS::sub" and "Can't modify non-lvalue method call of CLASS->sub".
Under DEBUGGING "Modification of a read-only value attempted at <location>" was changed to "Modification of a read-only value attempted <value> at <c file:line> at <location>"
Existing tests best cut off the " at" at the end.
A false-positive warning that was issued when using a numerically-quantified sub-pattern in a recursive regex has been silenced. [perl #131868]
The diagnostic Initialization of state variables in list context currently forbidden
has changed to Initialization of state variables in list currently forbidden
, because list-context initialization of single aggregate state variables is now permitted.
Failed to close in-place edit file %s: %s
was renamed to Failed to close in-place work file %s: %s.
delete argument is index/value array slice, use array slice
and delete argument is key/value hash slice, use hash slice
is gone, deleting key/value slices is now supported.
The warning about useless use of a concatenation operator in void context is now generated for expressions with multiple concatenations, such as $a.$b.$c
, which used to mistakenly not warn. [perl #6997]
Warnings that a variable or subroutine "masks earlier declaration in same ...", or that an our
variable has been redeclared, have been moved to a new warnings category "shadow". Previously they were in category "misc".
The deprecation warning from Sys::Hostname::hostname()
saying that it doesn't accept arguments now states the Perl version in which the warning will be upgraded to an error. [perl #124349]
The perldiag entry for the error regarding a set-id script has been expanded to make clear that the error is reporting a specific security vulnerability, and to advise how to fix it.
The Unable to flush stdout
error message was missing a trailing newline. [debian #875361]
Four new dtrace probes for hash and glob. See perldtrace and #240.
Add support for -d DESTDIR
, e.g. after
make -s -j4 install DESTDIR=$HOME/cperl-inst
cd $HOME/cperl-inst/usr/local/bin &&
./cperl cperlivp -p -d $HOME/cperl-inst
See [cperl #305]
Perl has been documented as requiring a C89 compiler to build since October 1998. A variety of simplifications have now been made to Perl's internals to rely on the features specified by the C89 standard. We believe that this internal change hasn't altered the set of platforms that Perl builds on, but please report a bug if Perl now has new problems building on your platform.
On GCC, -Werror=pointer-arith
is now enabled by default, disallowing arithmetic on void and function pointers.
Where an HTML version of the documentation is installed, the HTML documents now use relative links to refer to each other. Links from the index page of perlipc to the individual section documents are now correct. [perl #110056]
lib/unicore/mktables now correctly canonicalizes the names of the dependencies stored in the files it generates.
regen/mk_invlists.pl, unlike the other regen/*.pl scripts, used $0
to name itself in the dependencies stored in the files it generates. It now uses a literal so that the path stored in the generated files doesn't depend on how regen/mk_invlists.pl is invoked.
This lack of canonical names could cause test failures in t/porting/regen.t. [perl #132925]
Added support for the pgcc pgi compiler http://www.pgroup.com/. pgcc is very slow though. pgcc -O2 is 40% slower than gcc-6 -O3, pgcc -fast 30% slower. #279.
Travis and appveyor deploy now automatically master builds, besides tags.
inc_version_list
skips now older development versions. It only includes older non-devel versions with even numbers. See [cperl #284]
-Dusedevel
is needed to be added to all development versions anymore, it is now the default on such. A big warning is still being displayed, even in the usual silent auto mode -des
. See [cperl #283]
Fixed d_builtin_arith_overflow
detection and usage for 32bit systems with use64bitint
. They do use the ll
suffix, same as with WIN64. Now we can use this optimization. cperl-only.
Note that cperl ignores the new HAS_BUILTIN_{ADD,MUL,SUB}_OVERFLOW
config keys as we use the better HAS_BUILTIN_ARITH_OVERFLOW
for years already.
d_getcwd probe and key added. Sets HAS_GETCWD
d_get_current_dir_name probe and key added. Sets HAS_GET_CURRENT_DIR_NAME
getcwdnull probe and key added. Sets HAS_GETCWDNULL
d_realpath probe and key added. Sets HAS_REALPATH
d_builtin_clz probe and key added. Sets HAS_BUILTIN_CLZ. ("Count leading zeros"). Needed later for fast hopscotch hashing.
d_thread_safe_nl_langinfo_l
d_localeconv_l
d_mbrlen
d_mbrtowc
d_memrchr
d_nanosleep
d_strnlen
d_strtold_l
i_wchar
usenamedanoncv
Beware: HAS_MEMSET is undefined since v5.28, but always considered to be defined. Because of C89. cperl kept the HAS_MEMSET preprocessor definition for backcompat with extensions which do use it. It is used in all ppport.h files to use memzero().
Ditto: Keep HAS_MEMCHR
Ditto: Keep HAS_MEMCMP
Ditto: Keep HAS_MEMCPY
Ditto: Keep HAS_MEMMOVE
Ditto: Keep HAS_STRCHR
Ditto: Keep HAS_STRERROR
Ditto: Keep HAS_VPRINTF
Ditto: Keep HASVOLATILE
Ditto: Keep I_ASSERT in perl.h
Ditto: Keep I_FLOAT in perl.h
Ditto: Keep I_LIMITS in perl.h
Ditto: Keep I_MATH in perl.h
Ditto: Keep I_STDARG in perl.h
Ditto: Keep I_STDLIB in perl.h
Ditto: Keep I_STRING in perl.h
Ditto: Keep CAN_PROTOTYPE in perl.h
Ditto: Keep CAN_VAPROTO, _V
New generated shell config with the same content as git_version.h, for myconfig.
Added git_branch and git_describe.
avoiding needless miniperl recompilation on Config_git.pl, git_version.{sh,h}.
make minitest
can now be successfully be run directly after make miniperl
. The unicode datafiles are now built before, and tests pass even if no module was built or mktables failed.
Many fixes for make minitest
for cperl/XSConfig.
Added t/op/oelem.t for classes with more than 256 fields, realloc fields for bigger padsize 2, and computed field names. cperl-only.
Changed one case in t/op/symbolcache.t for static method optimizations. When you redefine a method, you need to clear the old method GV, to be able to call the new redefined one, as the static method optimization binds to the GV.
Fixed Porting/cmpVERSION.pl resp. t/porting/cmp_version.t.
Some flapping tests on slow windows smokers (appveyor) are now skipped.
Testing of the XS-APItest directory is now done in parallel, where applicable.
The watchdog timer count in re/pat_psycho.t can now be overridden.
This test can take a long time to run, so there is a timer to keep this in check (currently, 5 minutes). This commit adds checking the environment variable PERL_TEST_TIME_OUT_FACTOR
; if set, the time out setting is multiplied by its value.
harness no longer waits for 30 seconds when running t/io/openpid.t. [perl #121028] [perl #132867]
Improved some tests which depend in counting (eval \d)'s to use regex. Print the compiled regex when failing, not just the expected string. In this case t/lib/warnings/pad Storable used in Unicode::UCD, used by utf8 added another eval.
For the past few years we have released perl using three different archive formats: bzip (.bz2
), LZMA2 (.xz
) and gzip (.gz
). Since xz compresses better and decompresses faster, and gzip is more compatible and uses less memory, we have dropped the .bz2
archive format with this release. (If this poses a problem, do let us know; see "Reporting Bugs", below.)
Preliminary support for the Portland pgcc compiler (Linux, Darwin, Win32 only) has been added.
Compiler hints and other support for these apparently long-defunct platforms has been removed.
Support for long paths have been added to all platforms, for cwd
longer than 4096. Many kernels have limited support for it, but filesystems do. See [cperl #270].
Fixed hints for pgcc.
Use for getcwd(NULL)
or get_current_dir_name()
, which can return paths longer than 4096.
Compilation on CentOS 5 is now fixed.
threads became unstable with some upstream merges. default now to -Uuseithreads
.
Fixed Storable stacksize probing.
Fixed a lot of admin-specific file-permission tests.
Fixed hints for pgcc
Perl now correctly uses reentrant functions, like asctime_r
, on versions of Darwin that have support for them.
locale specific error messages are now thread-safe. cperl-only, [cperl #341]
cperl on mingw was previously unsupported and didn't compile nor work. We switched the windows packages to use mingw 32bit and 64bit instead of MSVC compiled packages, which do require a special MS runtime DLL.
Removed the broken dlltool, which corrupted 64bit DLL's for years. In our case Cpanel::JSON::XS and Unicode::Normalize. Just use gcc
to create dll's and import libs, as in cygwin.
Added version specific gcc config values.
The default mingw configs were extremely defensive and slow. Even gcc-2.95.3 settings were disabled. Now several modern builtins and attributes are used.
Fixed the wrong d_u32align
default, which caused Digest::MD5 to crash.
Fixed BUILTIN_*_OVERFLOW macros for mingw64, which uses long long for normal IV/UV on win64.
Removed the version suffix from the importlib which is the entry for $Config{libperl}
. -lcperl
works now for the compiler and embedders. Just keep the version on MSVC, e.g. cperl527.lib, as this had special logic in perlcc already.
Improved t/run/switchDBG.t for -D''
and -T
tests.
Fixed building of the extensions with the Extensions_normalize target.
Switched from C:\MinGW to C:\Strawberry\c as default CCHOME prefix. This is much more stable on 64bit, and easier to setup.
The compiler perlcc only works with very simple programs under mingw yet. With dynaloaded XS modules it usually fails.
Fixed invalid check_type_and_open macro
on mingw miniperl.
Several fix-ups for configure.com, marking function VMS has (or doesn't have).
CRTL features can now be set by embedders before invoking Perl by using the decc$feature_set
and decc$feature_set_value
functions. Previously any attempt to set features after image initialization were ignored.
File test operators for Unix permission bits that don't exist on a particular platform, such as -k
(sticky bit) on Windows, now check that the file being tested exists before returning the blanket false result, and yield the appropriate errors if the argument doesn't refer to a file.
Visual C++ compiler version detection has been improved to work on non-English language systems.
mingw, cygwin and the MSVC versions 10,12,14 smoke now ok with 32-bit and 64-bit.
Fixed upstream mkstemp API changes.
getcwd is deprecated on Windows. use _getcwd() instead.
PathTools: Support overlong paths for getdcwd(), using the wide API for overlong paths.
CAN_PROTOTYPE is now always defined, which might cause problems with the system cc compiler. ccom: Error: ./mg.h, line 12: redeclaration of formal parameter, sv
CAN_PROTOTYPE is now always defined, which might cause problems with the gcc-4.2 compiler.
Export re_op_compile
needed for re engines.
Added study API functions for possible internal costly optimizations of hv, av, cv, and rx, such as hash shrinking, regex and cv jit compilation, and av type promotion. For now implemented is hv_study()
, the rest are stubs.
Perl_croak_no_modify()
got 2 arguments, the macro is the same. The new croak_no_modify_sv(sv)
has better diagnostics with DEBUGGING and is used throughout core.
Many gv_fetch methods use now GV_CLASS, i.e. they try EXISTS and FETCH in the same stash lookup, not failing on restricted stashes.
The overload magic vtable (AMT) allows now readonly stashes. classes are not cached, readonly packages are.
Added "hv_undef_flags" in perlapi to the public API.
Refactored the fields API from global data into methods. Added a "HvFIELDS" in perlapi field to HvAUX as linear buffer of "name\0pad...\0" fields, no class %FIELDS
and @FIELDS
anymore. See [cperl #322]
"validate_proto" in perlintern got an additional cperl-only bool argument maybe_sig
.
A new function, Perl_langinfo() has been added. It is an (almost) drop-in replacement for the system nl_langinfo(3)
, but works on platforms that lack that; as well as being more thread-safe, and hiding some gotchas with locale handling from the caller. Code that uses this, needn't use localeconv(3) (and be affected by the gotchas) to find the decimal point, thousands separator, or currency symbol. See "Perl_langinfo" in perlapi.
A new API function sv_rvunweaken() has been added to complement sv_rvweaken(). The implementation was taken from "unweaken" in Scalar::Util.
A new flag, SORTf_UNSTABLE
, has been added. This will allow a future commit to make mergesort unstable when the user specifies ‘no sort stable’, since it has been decided that mergesort should remain stable by default.
A new optimisation phase has been added to the compiler, optimize_optree()
, which does a top-down scan of a complete optree just before the peephole optimiser is run. This phase is not currently hookable. This phase was previously in cperl named prefinalize_op
and postprocess_optree
.
An OP_MULTICONCAT
op has been added. At optimize_optree()
time, a chain of OP_CONCAT
and OP_CONST
ops, together optionally with an OP_STRINGIFY
and/or OP_SASSIGN
, are combined into a single OP_MULTICONCAT
op. The op is of type UNOP_AUX
, and the aux array contains the argument count, plus a pointer to a constant string and a set of segment lengths. For example with
my $x = "foo=$foo, bar=$bar\n";
the constant string would be "foo=, bar=\n"
and the segment lengths would be (4,6,1). If the string contains characters such as \x80
, whose representation changes under utf8, two sets of strings plus lengths are precomputed and stored.
Direct access to PL_keyword_plugin is not safe in the presence of multithreading. A new wrap_keyword_plugin function has been added to allow XS modules to safely define custom keywords even when loaded from a thread, analogous to PL_check / wrap_op_checker.
The PL_statbuf
interpreter variable has been removed.
The deprecated function to_utf8_case()
, accessible from XS code, has been removed.
A new function is_utf8_invariant_string_loc()
has been added that is like is_utf8_invariant_string()
but takes an extra pointer parameter into which is stored the location of the first variant character, if any are found.
XS modules can now automatically get reentrant versions of system functions on threaded perls.
By adding
#define PERL_REENTRANT
near the beginning of an XS
file, it will be compiled so that whatever reentrant functions perl knows about on that system will automatically and invisibly be used instead of the plain, non-reentrant versions. For example, if you write getpwnam()
in your code, on a system that has getpwnam_r()
all calls to the former will be translated invisibly into the latter. This does not happen except on threaded perls, as they aren't needed otherwise. Be aware that which functions have reentrant versions varies from system to system.
The PERL_NO_OP_PARENT
build define is no longer supported, which means that perl is now always built with PERL_OP_PARENT
enabled.
The format and content of the non-utf8 transliteration table attached to the op_pv
field of OP_TRANS
/OP_TRANSR
ops has changed. It's now a struct OPtrans_map
.
A new API function "dump_sub_cv" in perlapi has been added to avoid faking a slim CV to a full GV. cperl-only.
A new compiler #define
, dTHX_DEBUGGING
. has been added. This is useful for XS or C code that only need the thread context because their debugging statements that get compiled only under -DDEBUGGING
need one.
A new API function "Perl_setlocale" in perlapi has been added.
"sync_locale" in perlapi has been revised to return a boolean as to whether the system was using the global locale or not.
A new kind of magic scalar, called a "nonelem" scalar, has been introduced. It is stored in an array to denote a nonexistent element, whenever such an element is accessed in a potential lvalue context. It replaces the existing "defelem" (deferred element) magic wherever this is possible, being significantly more efficient. This means that some_sub($sparse_array[$nonelem])
no longer has to create a new magic defelem scalar each time, as long as the element is within the array.
It partially fixes the rare bug of deferred elements getting out of sync with their arrays when the array is shifted or unshifted. [perl #132729]
With a threaded perl, GV's are relocated as READONLY PADs. Add an abstraction "op_gv_set" in perlintern to simplify that.
Removed the obsolete OA_PADOP
class. Invalid and unused since 5.6.0. Kept OP_IS_PADOP
and made it legal for threaded perls. The B modules still print PADOP '#'
ops as such, which were dynamically converted from SVOP's to PADOP's threaded.
The three supported unicode BOM's UTF-8, UTF-16LE and UTF-16BE set the utf8 and unicode compile-time hints to match the documentation and expectation. cperl-only
Fixed several minor coverity issues.
Fixed signature corruption with skip'ed arguments without default and with 0, 1, undef or op defaults, such as in sub func ($, $=0, $=1, $=2, $=do{$i++} $="foo", $a="bar", $b="zoot")
, with the first $
, the 2nd $=0
, the 3rd $=1
and the 5th $=do{}
argument. cperl-only.
Harmonized TOKENBUF_SIZE and stack buf sizes
The max identifier length depends on the max tokenbuf size, which went from 256 in perl5 to 1024 in cperl, mostly to speed up parsing with a larger parser buffer. A few places still had hardcoded 256 tmpbuf sizes, which led to wrong error messages. See [cperl #293]. cperl-only
Fixed one place in ck_sort for utf8 lexical variable names, which passed the unneeded UTF8 flag to pad_findmy_pvn()
. In cperl all pads are normalized UTF8 for faster searches, the flag argument must be 0. See [cperl #293]. cperl-only
Fix regex stack recursion overflow with DEBUGGING
This is a regression since 5.26 (also in upstream perl5). Without DEBUGGING it failed with the error message "Unmatched ( in regex", now with more than 5000 open parens it will fail with the same error message. This would be security relevant if one would use a DEBUGGING perl in production as one can construct a pattern which writes arbitrary values to the stack, similar to the Storable ([cperl #257], [cpan #97526]) stack overflow and the old 5.10 regex stack overflow attack. See [cperl #293].
Fixed wrong "Don’t stringify GV in numeric cx outside warnings scope" optimization from 5.18, which fails with code like $* += (** = 0)
. See [cperl #299].
Added missing arity checks to readline
and readpipe
. E.g. readline(1,2)
and readpipe(1,2)
errors now. Those excessive args were previously called for side-effects, in case of constants or variables effectively ignored.
All internal ops are now properly arity checked. See [cperl #301].
More fixes for handling readonly packages, aka classes. Allow AMT (overload) cache updates, @ISA
searches and general class dispatch, falling back to AUTOLOAD in classes.
E.g. this works now: class XX{method m{"ok $self"}} XX->new->m
The string concat looked in the class XX for an overload for the concat "." op, and failed with "Modification of a read-only value attempted" on the class, when trying to update the AMT cache. On windows it also tried the "(qr"
overload. See [cperl #308]. cperl-only
List assignment (aassign
) could in some rare cases allocate an entry on the mortals stack and leave the entry uninitialized, leading to possible crashes. [perl #131570]
Attempting to apply an attribute to an our
variable where a function of that name already exists could result in a NULL pointer being supplied where an SV was expected, crashing perl. See [perl #131597].
Fixed thread-safety with locale-specific error messages on darwin. uselocal()
on darwin is not thread-safe, so we disable the local restauration to uselocal(LC_GLOBAL_LOCALE)
in child threads. cperl-only, [cperl #341]
split ' '
now correctly handles the argument being split when in the scope of the unicode_strings
feature. Previously, when a string using the single-byte internal representation contained characters that are whitespace by Unicode rules but not by ASCII rules, it treated those characters as part of fields rather than as field separators. [perl #130907]
Several built-in functions previously had bugs that could cause them to write to the internal stack without allocating room for the item being written. In rare situations, this could have led to a crash. These bugs have now been fixed, and if any similar bugs are introduced in future, they will be detected automatically in debugging builds.
These internal stack usage checks introduced are also done by the entersub
operator when calling XSUBs. This means we can report which XSUB failed to allocate enough stack space. [perl #131975]
Using a symbolic ref with postderef syntax as the key in a hash lookup was yielding an assertion failure on debugging builds. [perl #131627]
Array and hash variables whose names begin with a caret now admit indexing inside their curlies when interpolated into strings, as in "${^CAPTURE[0]}"
to index @{^CAPTURE}
. [perl #131664]
Fetching the name of a glob that was previously UTF-8 but wasn't any longer would return that name flagged as UTF-8. [perl #131263]
The perl sprintf()
function (via the underlying C function Perl_sv_vcatpvfn_flags()
) has been heavily reworked to fix many minor bugs, including the integer wrapping of large width and precision specifiers and potential buffer overruns. It has also been made faster in many cases.
Exiting from an eval
, whether normally or via an exception, now always frees temporary values (possibly calling destructors) before setting $@
. For example:
sub DESTROY { eval { die "died in DESTROY"; } }
eval { bless []; };
# $@ used to be equal to "died in DESTROY" here; it's now "".
Fixed a duplicate symbol failure with -flto -mieee-fp
builds. pp.c defined _LIB_VERSION
which -lieee
already defines. [perl #131786]
The tokenizer no longer consumes the exponent part of a floating point number if it's incomplete. [perl #131725]
On non-threaded builds, for m/$null/
where $null
is an empty string is no longer treated as if the /o
flag was present when the previous matching match operator included the /o
flag. The rewriting used to implement this behavior could confuse the interpreter. This matches the behaviour of threaded builds. [perl #124368]
Parsing a sub
definition could cause a use after free if the sub
keyword was followed by whitespace including newlines (and comments.) [perl #131836]
The tokenizer now correctly adjusts a parse pointer when skipping whitespace in a ${identifier}
construct. [perl #131949]
Accesses to ${^LAST_FH}
no longer assert after using any of a variety of I/O operations on a non-glob. [perl #128263]
The Copy()
, Move()
, Zero()
macros and their variants now assert if the pointers supplied are NULL
. ISO C considers supplying NULL pointers to the functions these macros are built upon as undefined behaviour even when their count parameters are zero. Based on these assertions and the original bug report three macro calls were made conditional. [perl #131746] [perl #131892]
The in-place sort optimisation now correctly strengthens weak references using the new sv_rvunweaken() API function.
Package names are now always included in :prototype
warnings [perl #131833]
Creating a thread with no parameters no longer tries to Copy()
a null pointer. This fixes an assertion failure and allows threaded builds to work again.
The je_old_stack_hwm
field, previously only found in the jmpenv
structure on debugging builds, has been added to non-debug builds as well. This fixes an issue with some CPAN modules caused by the size of this structure varying between debugging and non-debugging builds. [perl #131942]
The arguments to the ninstr()
macro are now correctly parenthesized.
A NULL pointer dereference in the S_regmatch()
function has been fixed. [perl #132017]
Calling exec PROGRAM LIST with an empty LIST
has been fixed. This should call execvp()
with an empty argv
array (containing only the terminating NULL
pointer), but was instead just returning false (and not setting $!). [perl #131730]
The gv_fetchmeth_sv
C function stopped working properly in Perl 5.22 when fetching a constant with a UTF-8 name if that constant subroutine was stored in the stash as a simple scalar reference, rather than a full typeglob. This has been fixed.
Single-letter debugger commands followed by an argument which starts with punctuation (e.g. p$^V
and x@ARGV
) now work again. They had been wrongly requiring a space between the command and the argument. [perl #120174]
splice now throws an exception ("Modification of a read-only value attempted") when modifying a read-only array. Until now it had been silently modifying the array. The new behaviour is consistent with the behaviour of push and unshift. [perl #131000]
stat()
, lstat()
, and file test operators now fail if given a filename containing a nul character, in the same way that open()
already fails.
stat()
, lstat()
, and file test operators now reliably set $!
when failing due to being applied to a closed or otherwise invalid file handle.
File test operators for Unix permission bits that don't exist on a particular platform, such as -k
(sticky bit) on Windows, now check that the file being tested exists before returning the blanket false result, and yield the appropriate errors if the argument doesn't refer to a file.
The in-place reverse optimisation now correctly strengthens weak references using the sv_rvunweaken() API function.
Fixed a read before buffer when parsing a range starting with \N{}
at the beginning of the character set for the transliteration operator. [perl #132245]
Fixed a leaked SV when parsing an empty \N{}
at compile-time. [perl #132245]
Calling do $path
on a directory or block device now yields a meaningful error code in $!
. [perl #125774]
Regexp substitution using an overloaded replacement value that provides a tainted stringification now correctly taints the resulting string. [perl #115266]
Lexical sub declarations in do
blocks such as do { my sub lex; 123 }
could corrupt the stack, erasing items already on the stack in the enclosing statement. This has been fixed. [perl #132442]
pack
and unpack
can now handle repeat counts and lengths that exceed two billion. [perl #119367]
Digits past the radix point in octal and binary floating point literals now have the correct weight on platforms where a floating point significand doesn't fit into an integer type.
The canonical truth value no longer has a spurious special meaning as a callable subroutine. It used to be a magic placeholder for a missing import
or unimport
method, but is now treated like any other string 1
. [perl #126042]
system
now reduces its arguments to strings in the parent process, so any effects of stringifying them (such as overload methods being called or warnings being emitted) are visible in the way the program expects. [perl #121105]
The readpipe()
built-in function now checks at compile time that it has only one parameter expression, and puts it in scalar context, thus ensuring that it doesn't corrupt the stack at runtime. [perl #4574]
sort
now performs correct reference counting when aliasing $a
and $b
, thus avoiding premature destruction and leakage of scalars if they are re-aliased during execution of the sort comparator. [perl #92264]
reverse
with no operand, reversing $_
by default, is no longer in danger of corrupting the stack. [perl #132544]
exec
, system
, et al are no longer liable to have their argument lists corrupted by reentrant calls and by magic such as tied scalars. [perl #129888]
Perl's own malloc
no longer gets confused by attempts to allocate more than a gigabyte on a 64-bit platform. [perl #119829]
Stacked file test operators in a sort comparator expression no longer cause a crash. [perl #129347]
An identity tr///
transformation on a reference is no longer mistaken for that reference for the purposes of deciding whether it can be assigned to. [perl #130578]
Lengthy hexadecimal, octal, or binary floating point literals no longer cause undefined behaviour when parsing digits that are of such low significance that they can't affect the floating point value. [perl #131894]
open $$scalarref...
and similar invocations no longer leak the file handle. [perl #115814]
Some convoluted kinds of regexp no longer cause an arithmetic overflow when compiled. [perl #131893]
The default typemap, by avoiding newGVgen
, now no longer leaks when XSUBs return file handles (PerlIO *
or FILE *
). [perl #115814]
Creating a BEGIN
block as an XS subroutine with a prototype no longer crashes because of the early freeing of the subroutine.
The printf
format specifier %.0f
no longer rounds incorrectly [perl #47602], and now shows the correct sign for a negative zero.
Fixed an issue where the error Scalar value @arrayname[0] better written as $arrayname
would give an error Cannot printf Inf with 'c'
when arrayname starts with Inf
. [perl #132645]
The Perl implementation of getcwd()
in Cwd
in the PathTools distribution now behaves the same as XS implementation on errors: it returns an error, and sets $!
. [perl #132648]
Vivify array elements when putting them on the stack. Fixes [perl #8910] (reported in April 2002).
Fixed parsing of braced subscript after parens. Fixes [perl #8045] (reported in December 2001).
tr/non_utf8/long_non_utf8/c
could give the wrong results when the length of the replacement character list was greater than 0x7fff.
tr/non_utf8/non_utf8/cd
failed to add the implied \x{100}-\x{7fffffff}
to the search character list.
Compilation failures within "perl-within-perl" constructs, such as with string interpolation and the right part of s///e
, now cause compilation to abort earlier.
Previously compilation could continue in order to report other errors, but the failed sub-parse could leave partly parsed constructs on the parser shift-reduce stack, confusing the parser, leading to perl crashes. [perl #125351]
Errors while compiling a regex character class could sometime trigger an assertion failure. [perl #132163]
-Dx
has been fixed to accept slim CVs without fake GV.
On threaded perls where the decimal point (radix) character is not a dot, it has been possible for a race to occur between threads when one needs to use the real radix character. This has now been fixed by use of a mutex on systems without thread-safe locales, and the problem just doesn't come up on those with thread-safe locales.
Fixed error message for illegal charnames, and avoid passing NUL into the charnames lookup, which is a potential security threat. E.g. on "\N{TILDE\000}" report "Missing right brace on \\N\{\}" as before with 5.27.2 and on "\N{TILDE\001}" report "Unknown charname 'TILDE\1'" and not "Unknown charname 'TILDE'". perl5.27.5 started reporting those errors with "Unknown charname 'TILDE'" hiding all characters behind the embedded NUL or any non-printable character. [cperl #342]
Fixed endless loop in the parser with a syntax error on an aborted class declaration, such as e.g. with class $
. The previous behavior was repeating the warning message Bareword found where operator expected
endlessly. [cperl #346] cperl-only
Fixed autovivifaction of hash slices and key/value hash slices in sub args. They are now consistent with a list of hash elements. hash slices still autovivify in for loops.
There's also a new syntax warning about this change, "No autovivification of hash slice anymore" in perldiag [cperl #347]. cperl-only
Fixed wrong panic: distributed hash flood
when dealing with large %^H
hints hashes, with >127 entries, such as _charnames.pm
in Regexp::Common
. Fixed the logic dealing with such a hints hash. [cperl #350]. cperl-only
Fixed endless rpeep compiler loop with a constant loop and a nested loop, which e.g. broke Net:HTTP
. [cperl #349]. cperl-only
Fixed missing compile-time AvSHAPED detection in nested scopes. E.g.:
my @a[1]; sub { $a[0]->[5] = 1 }->(); # mderef_u
my @b[1]; sub { $b[0] = 1 }->(); # aelemfast_lex_u
See [cperl #354]. cperl-only
Classes are still experimental, and have some limitations:
Cannot be created in an eval block or subroutine. The pad lookup is still global and not per optional CvPADLIST.
Method composition with overlapping field indices does not work yet. This requires the not yet finished inliner. panic: cannot yet adjust field indices when composing role %s::%s into %s %s [cperl #311]
Array and hash fields cannot be parsed yet.
Fixed return type of DynaLoader::dl_find_symbol_anywhere()
, the address, not the name. [cperl #352].
cperl 5.28.0c represents approximately 15 months of development since cperl 5.26.0c and contains approximately 860,000 lines of changes across 2,100 files from 73 authors.
Excluding auto-generated files, documentation and release tools, there were approximately 680,000 lines of changes to 1,100 .pm, .t, .c and .h files.
The following people are known to have contributed the improvements that became cperl 5.28.0:
Karl Williamson, Reini Urban, David Mitchell, Zefram, Tony Cook, Aaron Crane, Father Chrysostomos, Dagfinn Ilmari Mannsåker, Yves Orton, James E Keenan, Steve Hay, Lukas Mai, Craig A. Berry, Nicolas Rochelemagne, Sawyer X, Daniel Dragan, H.Merijn Brand, Chris 'BinGOs' Williams, Todd Rinaldo, Pali, Jarkko Hietaniemi, Karen Etheridge, Abigail, Dominic Hargreaves, Sergey Aleynikov, Matthew Horsfall, Marco Fontani, Smylers, Nicholas Clark, John Peacock, Tomasz Konojacki, Steffen Müller, Aristotle Pagaltzis, Ævar Arnfjörð Bjarmason, Eric Herman, Tom Hukins, vendethiel, Slaven Rezic, Renee Baecker, Marc-Philip Werner, Harald Jörg, George Hartzell, Graham Knop, Ricardo Signes, Andrew Fresh, J. Nick Koston, Neil Bowers, Dmitry Ulanov, sten22, Andy Lester, David H. Gutteridge, William N. Braswell, Jr, John SJ Anderson, Scott Lanning, Andy Dougherty, Vitali Peil, Peter John Acklam, Dan Collins, Niko Tyni, E. Choroba, Tom Wyant, John Lightsey, Jacques Germishuys, Gene Sullivan, Leon Timmermans, Eugen Konkov, François Perrad, John P. Linderman, Alexandr Savca, Ken Cotterill, Thomas Sibley, Shoichi Kaji.
The list above is almost certainly incomplete as it is automatically generated from version control history including the perl and cperl repos. In particular, it does not include the names of the (very much appreciated) contributors who reported issues to the Perl bug tracker and the cperl github issues.
Many of the changes included in this version originated in the CPAN modules included in Perl's core. We're grateful to the entire CPAN community for helping Perl to flourish.
For a more complete list of all of Perl's historical contributors, please see the AUTHORS file in the Perl source distribution.
Generated with:
cperl Porting/acknowledgements.pl cperl-5.26.0..HEAD -c
If you find what you think is a bug, you might check the perl bug database at https://rt.perl.org/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the cperlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
If you think it's a cperl specific bug or trust the cperl developers more please file an issue at https://github.com/perl11/cperl/issues.
If the bug you are reporting has security implications which make it inappropriate to send to a publicly archived mailing list, then see "SECURITY VULNERABILITY CONTACT INFORMATION" in perlsec For details of how to report the issue.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
Hey! The above document had some coding errors, which are explained below:
alternative text 'do "%s" failed, '.' is no longer in @INC; did you mean do "./%s"? ' contains non-escaped | or /