= Core Enhancements
= Experimental Try/Catch Syntax
An initial experimental attempt at providing C<try>/C<catch> notation has
been added.
use feature 'try';
try {
a_function();
}
catch ($e) {
warn "An error occurred: $e";
}
For more information, see L<perlsyn/"Try Catch Exception Handling">.
= C<qr/{,n}/> is now accepted
An empty lower bound is now accepted for regular expression quantifiers,
like C<{,3}>.
= Blanks freely allowed within but adjacent to curly braces
(in double-quotish contexts and regular expression patterns)
This means you can write things like S<C<\x{ FFFC }>> if you like. This
applies to all such constructs, namely C<\b{}>, C<\g{}>, C<\k{}>,
C<\N{}>, C<\o{}>, and C<\x{}>; as well as the regular expression
quantifier C<{I<m>,I<n>}>. C<\p{}> and C<\P{}> retain their
already-existing, even looser, rules mandated by the Unicode standard
(see L<perluniprops/Properties accessible through \p{} and \P{}>).
This ability is in effect regardless of the presence of the C</x>
regular expression pattern modifier.
Additionally, the comma in a regular expression braced quantifier may
have blanks (tabs or spaces) before and/or after the comma, like
S<C<qr/a{ 5, 7 }/>>.
= New octal syntax C<0oI<ddddd>>
It is now possible to specify octal literals with C<0o> prefixes,
as in C<0o123_456>, parallel to the existing construct to specify
hexadecimal literal C<0xI<ddddd>> and binary literal C<0bI<ddddd>>.
Also, the builtin C<oct()> function now accepts this new syntax.
See L<perldata/Scalar value constructors> and L<perlfunc/oct EXPR>.
= Performance Enhancements
=item *
Fix a memory leak in RegEx
[L<GH #18604|https://github.com/Perl/perl5/issues/18604>]
= Modules and Pragmata
= New Modules and Pragmata
=item *
L<ExtUtils::PL2Bat> 0.004 has been added to the Perl core.
This module is a generalization of the C<pl2bat> script. It being a script has
led to at least two forks of this code; this module will unify them under one
implementation with tests.
(and lots more changes)
- Import hints/darwin.sh patch from open pull request.
- The fenv test program in Configure caused warnings for not including
headers for printf() and exit(), causing the script to consider
fenv.h unusable.
Note that Big Sur identifies as 10.16 on Intel Macs, but as 11.0 on
Apple Silicon (ARM).
what is new for perl v5.30.0
Core Enhancements
Limited variable length lookbehind in regular expression pattern matching is now experimentally supported
Using a lookbehind assertion (like "(?<=foo?)" or "(?<!ba{1,9}r)" previously would generate an error and
refuse to compile. Now it compiles (if the maximum lookbehind is at most 255 characters), but raises a
warning in the new "experimental::vlb" warnings category. This is to caution you that the precise behavior
is subject to change based on feedback from use in the field.
See "(?<=pattern)" in perlre and "(?<!pattern)" in perlre.
The upper limit "n" specifiable in a regular expression quantifier of the form "{m,n}" has been doubled to 65534
The meaning of an unbounded upper quantifier "{m,}" remains unchanged. It matches 2**31 - 1 times on most
platforms, and more on ones where a C language short variable is more than 4 bytes long.
Unicode 12.1 is supported
Because of a change in Unicode release cycles, Perl jumps from Unicode 10.0 in Perl 5.28 to Unicode 12.1 in
Perl 5.30.
For details on the Unicode changes, see <https://www.unicode.org/versions/Unicode11.0.0/> for 11.0;
<https://www.unicode.org/versions/Unicode12.0.0/> for 12.0; and
<https://www.unicode.org/versions/Unicode12.1.0/> for 12.1. (Unicode 12.1 differs from 12.0 only in the
addition of a single character, that for the new Japanese era name.)
The Word_Break property, as in past Perl releases, remains tailored to behave more in line with expectations
of Perl users. This means that sequential runs of horizontal white space characters are not broken apart,
but kept as a single run. Unicode 11 changed from past versions to be more in line with Perl, but it left
several white space characters as causing breaks: TAB, NO BREAK SPACE, and FIGURE SPACE (U+2007). We have
decided to continue to use the previous Perl tailoring with regards to these.
Wildcards in Unicode property value specifications are now partially supported
You can now do something like this in a regular expression pattern
qr! \p{nv= /(?x) \A [0-5] \z / }!
which matches all Unicode code points whose numeric value is between 0 and 5 inclusive. So, it could match
the Thai or Bengali digits whose numeric values are 0, 1, 2, 3, 4, or 5.
This marks another step in implementing the regular expression features the Unicode Consortium suggests.
Most properties are supported, with the remainder planned for 5.32. Details are in "Wildcards in Property
Values" in perlunicode.
qr'\N{name}' is now supported
Previously it was an error to evaluate a named character "\N{...}" within a single quoted regular expression
pattern (whose evaluation is deferred from the normal place). This restriction is now removed.
Turkic UTF-8 locales are now seamlessly supported
Turkic languages have different casing rules than other languages for the characters "i" and "I". The
uppercase of "i" is LATIN CAPITAL LETTER I WITH DOT ABOVE (U+0130); and the lowercase of "I" is LATIN SMALL
LETTER DOTLESS I (U+0131). Unicode furnishes alternate casing rules for use with Turkic languages.
Previously, Perl ignored these, but now, it uses them when it detects that it is operating under a Turkic
UTF-8 locale.
It is now possible to compile perl to always use thread-safe locale operations.
Previously, these calls were only used when the perl was compiled to be multi-threaded. To always enable
them, add
-Accflags='-DUSE_THREAD_SAFE_LOCALE'
to your Configure flags.
Eliminate opASSIGN macro usage from core
This macro is still defined but no longer used in core
"-Drv" now means something on "-DDEBUGGING" builds
Now, adding the verbose flag ("-Dv") to the "-Dr" flag turns on all possible regular expression debugging.
Incompatible Changes
Assigning non-zero to $[ is fatal
Setting $[ to a non-zero value has been deprecated since Perl 5.12 and now throws a fatal error. See
"Assigning non-zero to $[ is fatal" in perldeprecation.
Delimiters must now be graphemes
See "Use of unassigned code point or non-standalone grapheme for a delimiter." in perldeprecation
Some formerly deprecated uses of an unescaped left brace "{" in regular expression patterns are now illegal
But to avoid breaking code unnecessarily, most instances that issued a deprecation warning, remain legal and
now have a non-deprecation warning raised. See "Unescaped left braces in regular expressions" in
perldeprecation.
Previously deprecated sysread()/syswrite() on :utf8 handles is now fatal
Calling sysread(), syswrite(), send() or recv() on a ":utf8" handle, whether applied explicitly or
implicitly, is now fatal. This was deprecated in perl 5.24.
There were two problems with calling these functions on ":utf8" handles:
o All four functions only paid attention to the ":utf8" flag. Other layers were completely ignored, so a
handle with ":encoding(UTF-16LE)" layer would be treated as UTF-8. Other layers, such as compression
are completely ignored with or without the ":utf8" flag.
o sysread() and recv() would read from the handle, skipping any validation by the layers, and do no
validation of their own. This could lead to invalidly encoded perl scalars.
my() in false conditional prohibited
Declarations such as "my $x if 0" are no longer permitted.
Fatalize $* and $#
These special variables, long deprecated, now throw exceptions when used.
Fatalize unqualified use of dump()
The "dump()" function, long discouraged, may no longer be used unless it is fully qualified, i.e.,
"CORE::dump()".
Remove File::Glob::glob()
The "File::Glob::glob()" function, long deprecated, has been removed and now throws an exception which
advises use of "File::Glob::bsd_glob()" instead.
"pack()" no longer can return malformed UTF-8
It croaks if it would otherwise return a UTF-8 string that contains malformed UTF-8. This protects against
potential security threats. This is considered a bug fix as well.
Any set of digits in the Common script are legal in a script run of another script
There are several sets of digits in the Common script. "[0-9]" is the most familiar. But there are also
"[\x{FF10}-\x{FF19}]" (FULLWIDTH DIGIT ZERO - FULLWIDTH DIGIT NINE), and several sets for use in
mathematical notation, such as the MATHEMATICAL DOUBLE-STRUCK DIGITs. Any of these sets should be able to
appear in script runs of, say, Greek. But the design of 5.30 overlooked all but the ASCII digits "[0-9]",
so the design was flawed. This has been fixed, so is both a bug fix and an incompatibility.
All digits in a run still have to come from the same set of ten digits.
JSON::PP enables allow_nonref by default
As JSON::XS 4.0 changed its policy and enabled allow_nonref by default, JSON::PP also enabled allow_nonref
by default.
Deprecations
In XS code, use of various macros dealing with UTF-8.
This deprecation was scheduled to become fatal in 5.30, but has been delayed to 5.32 due to problems that
showed up with some CPAN modules. For details of what's affected, see perldeprecation.
Performance Enhancements
o Translating from UTF-8 into the code point it represents now is done via a deterministic finite
automaton, speeding it up. As a typical example, "ord("\x7fff")" now requires 12% fewer instructions
than before. The performance of checking that a sequence of bytes is valid UTF-8 is similarly improved,
again by using a DFA.
o Eliminate recursion from finalize_op().
o A handful of small optimizations related to character folding and character classes in regular
expressions.
o Optimization of "IV" to "UV" conversions.
o Speed up of the integer stringification algorithm by processing two digits at a time instead of one.
o Improvements based on LGTM analysis and recommendation.
o Code optimizations in regcomp.c, regcomp.h, regexec.c.
o Regular expression pattern matching of things like "qr/[^a]/" is significantly sped up, where a is any
ASCII character. Other classes can get this speed up, but which ones is complicated and depends on the
underlying bit patterns of those characters, so differs between ASCII and EBCDIC platforms, but all case
pairs, like "qr/[Gg]/" are included, as is "[^01]".
Removed some ancient patches. Fix a pkglint warning.
Core Enhancements
Unicode 10.0 is supported
delete on key/value hash slices
Experimentally, there are now alphabetic synonyms for some regular expression assertions
Mixed Unicode scripts are now detectable
In-place editing with perl -i is now safer
Initialisation of aggregate state variables
Full-size inode numbers
The sprintf %j format size modifier is now available with pre-C99 compilers
Close-on-exec flag set atomically
String- and number-specific bitwise ops are no longer experimental
Locales are now thread-safe on systems that support them
New read-only predefined variable ${^SAFE_LOCALES}
Security
[CVE-2017-12837] Heap buffer overflow in regular expression compiler
[CVE-2017-12883] Buffer over-read in regular expression parser
[CVE-2017-12814] $ENV{$key} stack buffer overflow on Windows
Default Hash Function Change
Incompatible Changes
Subroutine attribute and signature order
Comma-less variable lists in formats are no longer allowed
The :locked and :unique attributes have been removed
\N{} with nothing between the braces is now illegal
Opening the same symbol as both a file and directory handle is no longer allowed
Use of bare << to mean <<"" is no longer allowed
Setting $/ to a reference to a non-positive integer no longer allowed
Unicode code points with values exceeding IV_MAX are now fatal
The B::OP::terse method has been removed
Use of inherited AUTOLOAD for non-methods is no longer allowed
Use of strings with code points over 0xFF is not allowed for bitwise string operators
Setting ${^ENCODING} to a defined value is now illegal
Backslash no longer escapes colon in PATH for the -S switch
the -DH (DEBUG_H) misfeature has been removed
Yada-yada is now strictly a statement
Sort algorithm can no longer be specified
Over-radix digits in floating point literals
Return type of unpackstring()
Deprecations
Use of vec on strings with code points above 0xFF is deprecated
Some uses of unescaped "{" in regexes are no longer fatal
Use of unescaped "{" immediately after a "(" in regular expression patterns is deprecated
Assignment to $[ will be fatal in Perl 5.30
hostname() won't accept arguments in Perl 5.32
Module removals
Performance Enhancements
Modules and Pragmata
Removal of use vars
Use of DynaLoader changed to XSLoader in many modules
Updated Modules and Pragmata
Removed Modules and Pragmata
More details are in the included perldelta.pod.
We need to remove -std=c89 so that compilers which default to C99 don't fail,
and don't automatically add -fstack-protector flags, leave it to the user to
decide via PKGSRC_USE_SSP. Fixes clang on SmartOS. Bump PKGREVISION.
Allow -Wl,-z arguments into lddlflags.
Fixes RELRO build.
Bump PKGREVISION.
While here, remove bogus comment from patch and remove reference
to two non-existing files.
Pkgsrc changes:
* Add candidate fix from https://rt.cpan.org/Public/Bug/Display.html?id=72467
* Remove patches which have been integrated upstream
* Rename and re-mould some patches which required adjustments
http://perlnews.org/2016/05/perl-5-24-released/ has pointer to
more details and says:
May 9 2016
Perl 5.24.0 has been released.
You can read about the changes which include:
Postfix dereferencing is no longer experimental
Unicode 8.0 is now supported
The autoderef feature has been removed
Perl 5.24.0 represents approximately 11 months of development since
Perl 5.22.0 and contains approximately 360,000 lines of changes
across 1,800 files from 77 authors.
exists already. This is not the case for bulk builds though. This fixes
p5-MARC-Charset, since p5-gdbm ended up without rpath to PREFIX/lib.
Fix some Perl interpreter paths while here. Bump revision.