PERL581DELTA(1)
๐ PERL581DELTA โจ (that's the perl581delta page, bestie, section 1 of the manual)
๐ธ NAME ๐ธ
perl581delta โ literally what's new in perl v5.8.1 ๐
๐ฆ DESCRIPTION ๐ฆ
Okay so this doc is the tea on everything that changed between the 5.8.0 release and the 5.8.1 release. Periodt.
If you're upgrading from something even older โ like, say, 5.6.1 โ bestie, read perl58delta FIRST ๐
because that one covers the glow-up from 5.6.0 to 5.8.0. Don't skip it, I'm begging.
And if you're sitting there like "wait, what was even the deal with 5.6.1??" โ it was, bug-fix-wise, pretty much identical to the development release 5.7.1. Confused? Valid. Here's a timeline that lowkey helps a little: it lists the new major releases, their maintenance releases, and the development releases.
New Maintenance Development
5.6.0 2000-Mar-22
5.7.0 2000-Sep-02
5.6.1 2001-Apr-08
5.7.1 2001-Apr-09
5.7.2 2001-Jul-13
5.7.3 2002-Mar-05
5.8.0 2002-Jul-18
5.8.1 2003-Sep-25
๐ Incompatible Changes ๐
Not me about to ruin your day โ these ones will break stuff. Read carefully, bestie. ๐ซถ
๐ฒ Hash Randomisation ๐ฒ
Mainly for security reasons, the "random ordering" of hashes got made even more random. Before, the order of hash elements coming out of keys(), values(), and each() was essentially random but still repeatable. Now? The order varies between different runs of Perl. Every. Single. Time. ๐ญ
Real talk though: Perl has never guaranteed any ordering of the hash keys, and the ordering has already changed several times over the lifetime of Perl 5. Also โ and this has always been true and still is โ the ordering of hash keys is affected by the insertion order.
The added randomness may affect applications. ๐
One possible scenario: your app's output includes hash data. Say you used the Data::Dumper module to dump data into different files, and then you compared those files to see whether the data changed. Well โ now you'll get false positives, because the order in which hashes get dumped will vary. The general cure is to sort the keys (or the values). Specifically for Data::Dumper, use the "Sortkeys" option. And if some particular order is really important, use tied hashes โ for example the Tie::IxHash module, which by default preserves the order in which the hash elements were added. ๐
A more subtle problem is relying on the order of "global destruction". That's what happens at the end of execution: Perl destroys all data structures, including user data. If your destructors (the DESTROY subroutines) assumed any particular ordering to the global destruction, there might be problems ahead. For example, in a destructor of one object you cannot assume that objects of any other class are still available โ unless you hold a reference to them. And if the environment variable PERL_DESTRUCT_LEVEL is set to a non-zero value, or if Perl is exiting a spawned thread, it will also destruct the ordinary references and the symbol tables that are no longer in use. You can't call a class method or an ordinary function on a class that has been collected that way. Nope. Not happening. ๐
Heads up: the hash randomisation is certain to reveal hidden assumptions about some particular ordering of hash elements, and outright bugs. It literally revealed a few bugs in the Perl core and core modules. ๐
Wanna turn it off at runtime? Set the environment variable PERL_HASH_SEED to 0 (zero) before running Perl โ for more info see "PERL_HASH_SEED" in perlrun. Or, to disable the feature completely at compile time, compile with -DNO_HASH_SEED (see INSTALL).
For the original rationale behind this whole change, see "Algorithmic Complexity Attacks" in perlsec. ๐ง
๐ฆ UTF-8 On Filehandles No Longer Activated By Locale ๐ฆ
In Perl 5.8.0, all filehandles โ including the standard filehandles โ were implicitly set to be in Unicode UTF-8 if the locale settings indicated the use of UTF-8. That feature caused way too many problems, so it got turned off and redesigned. See "Core Enhancements" for the new situation, bestie. โจ
๐ข Single-number v-strings are no longer v-strings before "=>" ๐ข
The version strings, aka v-strings (see "Version Strings" in perldata), got introduced back in Perl 5.6.0 and have been a whole source of confusion โ especially when the user didn't want to use it, but Perl thought it knew better. ๐ญ Peak main character energy from the interpreter, honestly.
The especially troublesome bit: before a "=>", a version string (a "v" followed by digits) was interpreted as a v-string instead of a string literal. In other words:
%h = ( v65 => 42 );
has meant, since Perl 5.6.0:
%h = ( 'A' => 42 );
(at least on platforms of ASCII progeny, iykyk) ๐
Perl 5.8.1 restores the more natural interpretation:
%h = ( 'v65' => 42 );
The multi-number v-strings like v65.66 and 65.66.67 still continue to be v-strings in Perl 5.8. Don't come for them, they're fine. ๐
๐ช (Win32) The -C Switch Has Been Repurposed ๐ช
The -C switch changed in an incompatible way. The old semantics of this switch only made sense in Win32 and only in the "use utf8" universe in the 5.6.x releases โ and they do not make sense for the Unicode implementation in 5.8.0. Since this switch couldn't have been used by anyone, it has been repurposed. ๐
The behavior that this switch enabled in the 5.6.x releases may be supported in a transparent, data-dependent fashion in a future release. No promises, no cap.
For the new life of this switch, see "UTF-8 no longer default under UTF-8 locales", and "-C" in perlrun.
๐ช (Win32) The /d Switch Of cmd.exe ๐ช
Perl 5.8.1 uses the /d switch when running the cmd.exe shell internally โ for system(), for backticks, and when opening pipes to external programs. The extra switch disables the execution of AutoRun commands from the registry, which is generally considered undesirable when running external programs. Slay, honestly.
If you wish to retain compatibility with the older behavior, set PERL5SHELL in your environment to "cmd /x/c". That's it, that's the fix. ๐
โจ Core Enhancements โจ
๐ UTF-8 no longer default under UTF-8 locales ๐
Okay so in Perl 5.8.0, a bunch of Unicode features showed up. And one of them was giving more drama than benefit, bestie: the automagic (and silent) "UTF-8-ification" of filehandles, including the standard ones, if your locale settings said you were using UTF-8.
Like, say you had en_US.UTF-8 as your locale. Then your STDIN and STDOUT were automatically "UTF-8" โ basically an implicit binmode(..., ":utf8") happened. So if you tried to print, idk, chr(0xff), you'd end up printing the bytes 0xc3 0xbf. Not exactly what you wanted unless you knew about this Perl 5.8.0 feature. And the problem? Most people didn't know. For example, in RedHat releases 8 and 9 the default locale setting is UTF-8, so all RedHat users got UTF-8 filehandles whether they wanted them or not. The pain was intensified because Perl 5.8.0's Unicode implementation (still) had nasty bugs, especially around s/// and tr///. (Bugs that were fixed in 5.8.1, phew.)
So they decided to backtrack. Changed it from implicit silent default to explicit conscious option. The new Perl command line option -C and its counterpart environment variable PERL_UNICODE can now be used to control how Perl and Unicode interact at interfaces like I/O and, for example, the command line arguments. See "-C" in perlrun and "PERL_UNICODE" in perlrun for more info.
๐จ Unsafe signals again available ๐จ
In Perl 5.8.0, the so-called "safe signals" were introduced. That means Perl no longer handles signals immediately but instead "between opcodes", when it's safe to do so. The earlier immediate handling could easily corrupt Perl's internal state, causing mysterious crashes.
But the new safer model has its problems too. Because now an opcode โ a basic unit of Perl execution โ is never interrupted but instead let to run to completion, certain operations that can take a long time now really take a long time. For example, certain network operations have their own blocking and timeout mechanisms, and being able to interrupt them immediately would be nice.
So Perl 5.8.1 introduces a "backdoor" to restore the pre-5.8.0 (pre-5.7.3, really) signal behaviour. Just set the environment variable PERL_SIGNALS to "unsafe", and the old immediate (and unsafe) signal handling behaviour returns. See "PERL_SIGNALS" in perlrun and "Deferred Signals (Safe Signals)" in perlipc.
In completely unrelated news, you can now use safe signals with POSIX::SigAction. See "POSIX::SigAction" in POSIX.
๐ Tied Arrays with Negative Array Indices ๐
Formerly, the indices passed to FETCH, STORE, EXISTS, and DELETE methods in a tied array class were always non-negative. If the actual argument was negative, Perl would call FETCHSIZE implicitly and add the result to the index before passing the result to the tied array method. This behaviour is now optional. If the tied array class contains a package variable named $NEGATIVE_INDICES which is set to a true value, negative values will be passed to FETCH, STORE, EXISTS, and DELETE unchanged.
๐ local ${$x} ๐
The syntaxes
local ${$x}
local @{$x}
local %{$x}
now do localise variables, given that the $x is a valid variable name.
๐ Unicode Character Database 4.0.0 ๐
The copy of the Unicode Character Database included in Perl 5.8 has been updated to 4.0.0 from 3.2.0. This means, for example, that the Unicode character properties are as in Unicode 4.0.0.
โ ๏ธ Deprecation Warnings โ ๏ธ
There is one new feature deprecation. Perl 5.8.0 forgot to add some deprecation warnings; these warnings have now been added. Finally, a reminder of an impending feature removal.
(Reminder) Pseudo-hashes are deprecated (really)
Pseudo-hashes were deprecated in Perl 5.8.0 and will be removed in Perl 5.10.0, see perl58delta for details. Each attempt to access pseudo-hashes will trigger the warning "Pseudo-hashes are deprecated". If you really want to continue using pseudo-hashes but not to see the deprecation warnings, use:
no warnings 'deprecated';
Or you can continue to use the fields pragma, but please don't expect the data structures to be pseudohashes any more.
(Reminder) 5.005-style threads are deprecated (really)
5.005-style threads (activated by use Thread;) were deprecated in Perl 5.8.0 and will be removed after Perl 5.8, see perl58delta for details. Each 5.005-style thread creation will trigger the warning "5.005 threads are deprecated". If you really want to continue using the 5.005 threads but not to see the deprecation warnings, use:
no warnings 'deprecated';
(Reminder) The $* variable is deprecated (really)
The $* variable controlling multi-line matching has been deprecated and will be removed after 5.8. The variable has been deprecated for a long time, and a deprecation warning "Use of $* is deprecated" is given, now the variable will just finally be removed. The functionality has been supplanted by the /s and /m modifiers on pattern matching. If you really want to continue using the $*-variable but not to see the deprecation warnings, use:
no warnings 'deprecated';
๐ Miscellaneous Enhancements ๐
mapin void context is no longer expensive.mapis now context aware, and will not construct a list if called in void context.- If a socket gets closed by the server while printing to it, the client now gets a SIGPIPE. While this new feature was not planned, it fell naturally out of PerlIO changes, and is to be considered an accidental feature.
PerlIO::get_layers(FH)returns the names of the PerlIO layers active on a filehandle.PerlIO::vialayers can now have an optional UTF8 method to indicate whether the layer wants to "auto-:utf8" the stream.utf8::is_utf8()has been added as a quick way to test whether a scalar is encoded internally in UTF-8 (Unicode).
๐ฆ Modules and Pragmata ๐ฆ
๐ Updated Modules And Pragmata ๐
The following modules and pragmata have been updated since Perl 5.8.0:
- base
- B::Bytecode โ In much better shape than it used to be. Still far from perfect, but maybe worth a try.
- B::Concise
- B::Deparse
- Benchmark โ An optional feature,
:hireswallclock, now allows for high resolution wall clock times (uses Time::HiRes). - ByteLoader โ See B::Bytecode.
- bytes โ Now has
bytes::substr. - CGI
- charnames โ One can now have custom character name aliases.
- CPAN โ There is now a simple command line frontend to the CPAN.pm module called
cpan. - Data::Dumper โ A new option,
Pair, allows choosing the separator between hash keys and values. - DB_File
- Devel::PPPort
- Digest::MD5
- Encode โ Significant updates on the encoding pragma functionality (
tr///and the DATA filehandle, formats).
If a filehandle has been marked as to have an encoding, unmappable characters are detected already during input, not later (when the corrupted data is being used).
The ISO 8859-6 conversion table has been corrected (the 0x30..0x39 erroneously mapped to U+0660..U+0669, instead of U+0030..U+0039). The GSM 03.38 conversion did not handle escape sequences correctly. The UTF-7 encoding has been added (making Encode feature-complete with Unicode::String).
- fields
- libnet
- Math::BigInt โ A lot of bugs have been fixed since v1.60, the version included in Perl v5.8.0. Especially noteworthy are the bug in Calc that caused
divandmodto fail for some large values, and the fixes to the handling of bad inputs.
Some new features were added, e.g. the broot() method, you can now pass parameters to config() to change some settings at runtime, and it is now possible to trap the creation of NaN and infinity.
As usual, some optimizations took place and made the math overall a tad faster. In some cases, quite a lot faster, actually. Especially alternative libraries like Math::BigInt::GMP benefit from this. In addition, a lot of the quite clunky routines like fsqrt() and flog() are now much much faster.
- MIME::Base64
- NEXT โ Diamond inheritance now works.
- Net::Ping
- PerlIO::scalar โ Reading from non-string scalars (like the special variables, see
perlvar) now works. - podlators
- Pod::LaTeX
- PodParsers
- Pod::Perldoc โ Complete rewrite. As a side-effect, no longer refuses to startup when run by root.
- Scalar::Util โ New utilities:
refaddr,isvstring,looks_like_number,set_prototype. - Storable โ Can now store code references (via
B::Deparse, so not foolproof). - strict โ Earlier versions of the strict pragma did not check the parameters implicitly passed to its
"import"(use) and"unimport"(no) routine. This caused the false idiom such as:
use strict qw(@ISA);
@ISA = qw(Foo);
This however (probably) raised the false expectation that the strict refs, vars and subs were being enforced (and that @ISA was somehow "declared"). But the strict refs, vars, and subs are not enforced when using this false idiom.
Starting from Perl 5.8.1, the above will cause an error to be raised. This may cause programs which used to execute seemingly correctly without warnings and errors to fail when run under 5.8.1. This happens because
use strict qw(@ISA);
will now fail with the error:
Unknown 'strict' tag(s) '@ISA'
The remedy to this problem is to replace this code with the correct idiom:
use strict;
use vars qw(@ISA);
@ISA = qw(Foo);
- Term::ANSIcolor
- Test::Harness โ Now much more picky about extra or missing output from test scripts.
- Test::More
- Test::Simple
- Text::Balanced
- Time::HiRes โ Use of
nanosleep(), if available, allows mixing subsecond sleeps with alarms. - threads โ Several fixes, for example for
join()problems and memory leaks. In some platforms (like Linux) that use glibc the minimum memory footprint of one ithread has been reduced by several hundred kilobytes. - threads::shared โ Many memory leaks have been fixed.
- Unicode::Collate
- Unicode::Normalize
- Win32::GetFolderPath
- Win32::GetOSVersion โ Now returns extra information.
๐ ๏ธ Utility Changes โจ
okay bestie, the tools got a glow-up ๐
- The
h2xsutility now produces a more modern layout:Foo-Bar/lib/Foo/Bar.pminstead ofFoo/Bar/Bar.pm. Also, the boilerplate test is now calledt/Foo-Bar.tinstead oft/1.t. not the chaotic old naming era anymore, we're organized now ๐ - The Perl debugger (
lib/perl5db.pl) has now been extensively documented and bugs found while documenting have been fixed. like, they documented it and the documenting found bugs. icon behavior honestly ๐ฅ perldochas been rewritten from scratch to be more robust and feature rich. full glow-up, no notes ๐perlcc -Bworks now at least somewhat better, whileperlcc -cis rather more broken. (The Perl compiler suite as a whole continues to be experimental.)
lowkey one step forward, one step back, but the whole compiler suite is still experimental so keep that in mind bestie ๐
๐ New Documentation โจ
so many new pages dropped, it's giving library restock ๐ฆ
perl573deltahas been added to list the differences between the (now quite obsolete) development releases 5.7.2 and 5.7.3.perl58deltahas been added: it is the perldelta of 5.8.0, detailing the differences between 5.6.0 and 5.8.0.perlartistichas been added: it is the Artistic License in pod format, making it easier for modules to refer to it.perlcheathas been added: it is a Perl cheat sheet. (study material bestie, keep it under your pillow ๐ธ)perlgplhas been added: it is the GNU General Public License in pod format, making it easier for modules to refer to it.perlmacosxhas been added to tell about the installation and use of Perl in Mac OS X.perlos400has been added to tell about the installation and use of Perl in OS/400 PASE.perlrerefhas been added: it is a regular expressions quick reference.
โ๏ธ Installation and Configuration Improvements โจ
- The Unix standard Perl location,
/usr/bin/perl, is no longer overwritten by default if it exists. This change was very prudent because so many Unix vendors already provide a/usr/bin/perl, but simultaneously many system utilities may depend on that exact version of Perl, so better not to overwrite it. fr fr, do NOT touch other people's perl, that's their main character ๐ซถ - One can now specify installation directories for site and vendor man and HTML pages, and site and vendor scripts. See
INSTALL. - One can now specify a destination directory for Perl installation by specifying the
DESTDIRvariable formake install. (This feature is slightly different from the previousConfigure -Dinstallprefix=....) SeeINSTALL. - gcc versions 3.x introduced a new warning that caused a lot of noise during Perl compilation:
gcc -Ialreadyknowndirectory (warning: changing search order). This warning has now been avoided by Configure weeding out such directories before the compilation. no more spam in the build log, we love a quiet queen ๐ - One can now build subsets of Perl core modules by using the Configure flags
-Dnoextensions=...and-Donlyextensions=..., seeINSTALL.
๐ Platform-specific enhancements ๐ซ
- In Cygwin Perl can now be built with threads (
Configure -Duseithreads). This works with both Cygwin 1.3.22 and Cygwin 1.5.3. - In newer FreeBSD releases Perl 5.8.0 compilation failed because of trying to use
malloc.h, which in FreeBSD is just a dummy file, and a fatal error to even try to use. Nowmalloc.his not used. dodged that whole situation ๐ - Perl is now known to build also in Hitachi HI-UXMPP.
- Perl is now known to build again in LynxOS.
- Mac OS X now installs with Perl version number embedded in installation directory names for easier upgrading of user-compiled Perl, and the installation directories in general are more standard. In other words, the default installation no longer breaks the Apple-provided Perl. On the other hand, with
Configure -Dprefix=/usryou can now really replace the Apple-supplied Perl (please be careful).
โ ๏ธ that Configure -Dprefix=/usr move is powerful and scary, bestie. please be careful, that's the whole system's perl ๐ญ
- Mac OS X now builds Perl statically by default. This change was done mainly for faster startup times. The Apple-provided Perl is still dynamically linked and shared, and you can enable the sharedness for your own Perl builds by
Configure -Duseshrplib. - Perl has been ported to IBM's OS/400 PASE environment. The best way to build a Perl for PASE is to use an AIX host as a cross-compilation environment. See
README.os400. - Yet another cross-compilation option has been added: now Perl builds on OpenZaurus, a Linux distribution based on Mandrake + Embedix for the Sharp Zaurus PDA. See the
Cross/READMEfile. - Tru64 when using gcc 3 drops the optimisation for
toke.cto-O2because of gigantic memory use with the default-O3. - Tru64 can now build Perl with the newer Berkeley DBs.
- Building Perl on WinCE has been much enhanced, see
README.ceandREADME.perlce.
๐ Selected Bug Fixes โจ
๐ Closures, eval and lexicals ๐ธ
There have been many fixes in the area of anonymous subs, lexicals and closures. Although this means that Perl is now more "correct", it is possible that some existing code will break that happens to rely on the faulty behaviour. In practice this is unlikely unless your code contains a very complex nesting of anonymous subs, evals and lexicals.
bestie listen, "more correct" can still break your old code if your old code was vibing with the bugs. it's rare unless you're doing a wildly complex nesting situation, but heads up ๐ซถ
๐งฐ Generic fixes ๐
- If an input filehandle is marked
:utf8and Perl sees illegal UTF-8 coming in when doing<FH>, if warnings are enabled a warning is immediately given - instead of being silent about it and Perl being unhappy about the broken data later. (The:encoding(utf8)layer also works the same way.) no more silently suffering, we speak up now ๐ค binmode(SOCKET, ":utf8")only worked on the input side, not on the output side of the socket. Now it works both ways.- For threaded Perls certain system database functions like
getpwent()andgetgrent()now grow their result buffer dynamically, instead of failing. This means that at sites with lots of users and groups the functions no longer fail by returning only partial results. - Perl 5.8.0 had accidentally broken the capability for users to define their own uppercase<->lowercase Unicode mappings (as advertised by the Camel). This feature has been fixed and is also documented better.
- In 5.8.0 this
$some_unicode .= <FH>;
didn't work correctly but instead corrupted the data. This has now been fixed.
- Tied methods like
FETCHetc. may now safely access tied values, i.e. resulting in a recursive call toFETCHetc. Remember to break the recursion, though.
โ ๏ธ yes you CAN recurse now, but you still have to break the recursion yourself or you're gonna have a bad time, that's on you bestie ๐
- At startup Perl blocks the
SIGFPEsignal away since there isn't much Perl can do about it. Previously this blocking was in effect also for programs executed from within Perl. Now Perl restores the originalSIGFPEhandling routine, whatever it was, before running external programs. - Linenumbers in Perl scripts may now be greater than 65536, or 216. (Perl scripts have always been able to be larger than that, it's just that the linenumber for reported errors and warnings have "wrapped around".) While scripts that large usually indicate a need to rethink your code a bit, such Perl scripts do exist, for example as results from generated code. Now linenumbers can go all the way to 4294967296, or 232. slay, no more wrap-around chaos ๐ฅ
๐ฅ๏ธ Platform-specific fixes โจ
๐ง Linux
- Setting
$0works again (with certain limitations that Perl cannot do much about: see"$0"inperlvar)
๐ HP-UX
- Setting
$0now works.
๐ฆ VMS
- Configuration now tests for the presence of
poll(), andIO::Pollnow uses the vendor-supplied function if detected. - A rare access violation at Perl start-up could occur if the Perl image was installed with privileges or if there was an identifier with the subsystem attribute set in the process's rightslist. Either of these circumstances triggered tainting code that contained a pointer bug. The faulty pointer arithmetic has been fixed.
- The length limit on values (not keys) in the
%ENVhash has been raised from 255 bytes to 32640 bytes (except when thePERL_ENV_TABLESsetting overrides the default use of logical names for%ENV). If it is necessary to access these long values from outside Perl, be aware that they are implemented using search list logical names that store the value in pieces, each 255-byte piece (up to 128 of them) being an element in the search list. When doing a lookup in%ENVfrom within Perl, the elements are combined into a single value. The existing VMS-specific ability to access individual elements of a search list logical name via the$ENV{'foo;N'}syntax (where N is the search list index) is unimpaired. - The piping implementation now uses local rather than global DCL symbols for inter-process communication.
File::Findcould become confused when navigating to a relative directory whose name collided with a logical name. This problem has been corrected by adding directory syntax to relative path names, thus preventing logical name translation.
๐ช Win32
- A memory leak in the
fork()emulation has been fixed. - The return value of the
ioctl()built-in function was accidentally broken in 5.8.0. This has been corrected. - The internal message loop executed by perl during blocking operations sometimes interfered with messages that were external to Perl. This often resulted in blocking operations terminating prematurely or returning incorrect results, when Perl was executing under environments that could generate Windows messages. This has been corrected.
- Pipes and sockets are now automatically in binary mode.
- The four-argument form of
select()did not preserve$!(errno) properly when there were errors in the underlying call. This is now fixed. - The "CR CR LF" problem of has been fixed,
binmode(FH, ":crlf")is now effectively a no-op.
๐ฅ New or Changed Diagnostics ๐ฅ
Okay bestie, every single warning that had anything to do with pack() and unpack() got a glow-up โ they're all more informative and more consistent now. Slay. ๐
Changed "A thread exited while %d threads were running"
The old version was literally
A thread exited while %d other threads were still running
and that was misleading af, because that other was counting the thread that's giving you the warning too. Rude and wrong. ๐
Removed "Attempt to clear a restricted hash"
Bestie, clearing a restricted hash is not illegal. So the warning got yeeted. Gone. Periodt.
New "Illegal declaration of anonymous subroutine"
You have to specify the block of code for sub. That's the whole thing. Non-negotiable. ๐
Changed "Invalid range "%s" in transliteration operator"
The old version said
Invalid [] range "%s" in transliteration operator
and it was just... simply wrong, because there are no "[] ranges" in tr///. Not a thing. Never was. โจ
New "Missing control char name in \c"
Self-explanatory, honestly. It says what it says. ๐ซถ
New "Newline in left-justified string for %s"
Because the padding spaces would show up after the newline, which is lowkey probably not what you had in mind. ๐ญ
New "Possible precedence problem on bitwise %c operator"
If you're out here thinking that
$x & $y == 0
tests whether the bitwise AND of $x and $y is zero... bestie, you are going to LOVE this warning. ๐
New "Pseudo-hashes are deprecated"
This one should've already been in 5.8.0, because they are deprecated. Facts. No cap. ๐
New "read() on %s filehandle %s"
You literally cannot read() (or sysread()) from a closed or unopened filehandle. It's giving impossible. ๐ซ
New "5.005 threads are deprecated"
Again โ should've been in 5.8.0 already, since they are, in fact, deprecated. Better late than never I guess. ๐ฆ
New "Tied variable freed while still in use"
Something pulled the plug on a live tied variable, so Perl plays it safe and bails out. Dramatic? Yes. Necessary? Also yes. ๐ฅ
New "To%s: illegal mapping '%s'"
An illegal user-defined Unicode casemapping was specified. That's it, that's the tea. ๐
New "Use of freed value in iteration"
Something modified the values being iterated over. And that is not good. Not good at all. ๐
๐ ๏ธ Changed Internals ๐ ๏ธ
Real talk: this news only matters to you if you write XS code, or if you like to know about or hack Perl internals (and yes, using Devel::Peek or any of the B:: modules counts, bestie), or if you like running Perl with the -D option. Otherwise you can vibe past this. ๐
The embedding examples of perlembed have been reviewed so they're up to date and consistent โ for example, the correct use of PERL_SYS_INIT3() and PERL_SYS_TERM(). โจ
Extensive reworking of the pad code (the code responsible for lexical variables) has been conducted by Dave Mitchell. Iconic behaviour honestly.
Extensive work on the v-strings by John Peacock. ๐
UTF-8 length and position cache: to speed up the handling of Unicode (UTF-8) scalars, a cache was introduced. Potential problems exist if an extension bypasses the official APIs and directly modifies the PV of an SV โ the UTF-8 cache does not get cleared as it should. So like... don't do that. ๐ซ
APIs obsoleted in Perl 5.8.0 โ like sv_2pv, sv_catpvn, sv_catsv, sv_setsv โ are again available. Welcome back babes. ๐
Certain Perl core C APIs like cxinc and regatom are no longer available at all to code outside the Perl core of the Perl core extensions. This is intentional. They never should have been available with the shorter names, and if your application depends on them, you should (be ashamed and) contact perl5-porters to discuss what are the proper APIs. ๐ณ
Certain Perl core C APIs like "Perl_list" are no longer available without their "Perl_" prefix. If your XS module stops working because some functions cannot be found, in many cases a simple fix is to add the "Perl_" prefix to the function and the thread context "aTHX_" as the first argument of the function call. This is also how it should always have been done โ letting the Perl_-less forms leak from the core was an accident. For cleaner embedding you can also force this for all APIs by defining at compile time the cpp define PERL_NO_SHORT_NAMES.
Perl_save_bool() has been added. New function just dropped. โจ
Regexp objects (those created with "qr") now have S-magic rather than R-magic. This fixed regexps of the form /...(??{...;$x})/ to no longer ignore changes made to $x. The S-magic avoids dropping the caching optimization and making (??{...}) constructs obscenely slow (and consequently useless). See also "Magic Variables" in perlguts. Regexp::Copy was affected by this change. ๐
The Perl internal debugging macros DEBUG() and DEB() have been renamed to PERL_DEBUG() and PERL_DEB() to avoid namespace conflicts. Glow-up for the namespace. ๐
"-DL" removed (the leaktest had been broken and unsupported for years, use alternative debugging mallocs or tools like valgrind and Purify). Rip bozo. ๐
Verbose modifier "v" added for "-DXv" and "-Dsv", see perlrun. ๐
๐งช New Tests ๐งช
In Perl 5.8.0 there were about 69000 separate tests in about 700 test files. In Perl 5.8.1 there are about 77000 separate tests in about 780 test files. Growth! We love to see it. ๐
The exact numbers depend on the Perl configuration and on the operating system platform. So don't come for me if your count is different. ๐
โ ๏ธ Known Problems โ ๏ธ
The hash randomisation mentioned in "Incompatible Changes" is definitely problematic: it will wake dormant bugs and shake out bad assumptions. It's giving chaos demon but like, on purpose. ๐ญ
If you want to use mod_perl 2.x with Perl 5.8.1, you will need mod_perl-1.99_10 or higher. Earlier versions of mod_perl 2.x do not work with the randomised hashes. (mod_perl 1.x works fine, bestie.) You will also need Apache::Test 1.04 or higher. ๐
Many of the rarer platforms that worked 100% or pretty close to it with perl 5.8.0 have been left a little bit untended since their maintainers have been otherwise busy lately, and therefore there will be more failures on those platforms. Such platforms include Mac OS Classic, IBM z/OS (and other EBCDIC platforms), and NetWare. The most common Perl platforms (Unix and Unix-like, Microsoft platforms, and VMS) have large enough testing and expert population that they are doing well. Main character platforms thriving, rare platforms in their flop era. ๐ฆ
Tied hashes in scalar context
Tied hashes do not currently return anything useful in scalar context โ for example when used as boolean tests:
if (%tied_hash) { ... }
The current nonsensical behaviour is always to return false, regardless of whether the hash is empty or has elements. Literally always false. Make it make sense. ๐
The root cause is that there is no interface for the implementors of tied hashes to implement the behaviour of a hash in scalar context. So it's not anyone's fault really, it's just a gap. ๐ซ
Net::Ping 450_service and 510_ping_udp failures
The subtests 9 and 18 of lib/Net/Ping/t/450_service.t, and the subtest 2 of lib/Net/Ping/t/510_ping_udp.t might fail if you have an unusual networking setup. For example in the latter case the test is trying to send a UDP ping to the IP address 127.0.0.1. So if your setup is weird, that's on you bestie. ๐ซถ
B::C
The C-generating compiler backend B::C (the frontend being "perlcc -c") is even more broken than it used to be because of the extensive lexical variable changes. Not the vibe. ๐ญ
The good news is that B::Bytecode and ByteLoader are better than they used to be. So we take those. โจ
๐ฅ๏ธ Platform Specific Problems ๐ฅ๏ธ
EBCDIC Platforms
IBM z/OS and other EBCDIC platforms continue to be problematic regarding Unicode support. Many Unicode tests are skipped when they really should be fixed. Skipping is not slaying, it's just avoidance. ๐
Cygwin 1.5 problems
In Cygwin 1.5 the io/tell and op/sysio tests have failures for some yet unknown reason. Mysterious. Spooky. ๐
In 1.5.5 the threads tests stress_cv, stress_re, and stress_string are failing unless the environment variable PERLIO is set to "perlio" (which makes also the io/tell failure go away). One little env var, doing all that work. Iconic. โจ
Perl 5.8.1 does build and work well with Cygwin 1.3: with (uname -a) "CYGWIN_NT-5.0 ... 1.3.22(0.78/3/2) 2003-03-18 09:20 i686 ..." a 100% "make test" was achieved with "Configure -des -Duseithreads". 100%! We love a clean run. ๐
HP-UX: HP cc warnings about sendfile and sendpath
With certain HP C compiler releases (e.g. B.11.11.02) you will get many warnings like this (lines wrapped for easier reading):
cc: "/usr/include/sys/socket.h", line 504: warning 562:
Redeclaration of "sendfile" with a different storage class specifier:
"sendfile" will have internal linkage.
cc: "/usr/include/sys/socket.h", line 505: warning 562:
Redeclaration of "sendpath" with a different storage class specifier:
"sendpath" will have internal linkage.
The warnings show up both during the build of Perl and during certain lib/ExtUtils tests that invoke the C compiler. The warning, however, is not serious and can be ignored. It's just loud. It's giving attention-seeking. ๐
IRIX: t/uni/tr_7jis.t falsely failing
The test t/uni/tr_7jis.t is known to report failure under 'make test' or the test harness with certain releases of IRIX (at least IRIX 6.5 and MIPSpro Compilers Version 7.3.1.1m), but if run manually the test fully passes. So it's a liar. A little drama queen test. ๐ญ
Mac OS X: no usemymalloc
The Perl malloc ("-Dusemymalloc") does not work at all in Mac OS X. This is not that serious, though, since the native malloc works just fine. No biggie bestie. ๐
Tru64: No threaded builds with GNU cc (gcc)
In the latest Tru64 releases (e.g. v5.1B or later) gcc cannot be used to compile a threaded Perl (-Duseithreads) because the system "<pthread.h>" file doesn't know about gcc. They're not acquainted. It's awkward. ๐
Win32: sysopen, sysread, syswrite
As of the 5.8.0 release, sysopen()/sysread()/syswrite() do not behave like they used to in 5.6.1 and earlier with respect to "text" mode. These built-ins now always operate in "binary" mode (even if sysopen() was passed the O_TEXT flag, or if binmode() was used on the file handle).
Note that this issue should only make a difference for disk files, as sockets and pipes have always been in "binary" mode in the Windows port.
As this behavior is currently considered a bug, compatible behavior may be re-introduced in a future release. Until then, the use of sysopen(), sysread() and syswrite() is not supported for "text" mode operations. So like, don't. Seriously. ๐
๐ฎ Future Directions ๐ฎ
okay so bestie, here's the tea on what might pop off in the future ๐ The first publicly available releases having these characteristics will be the developer releases Perl 5.9.x, culminating in the Perl 5.10.0 release. These are our best guesses at the moment: we reserve the right to rethink. (as we should ๐ )
- PerlIO will become The Default. Currently (in Perl 5.8.x) the
stdiolibrary is still used if Perl thinks it can use certain tricks to makestdiogo really fast. For future releases our goal is to make PerlIO go even faster. speed era incoming ๐๏ธโจ - A new feature called assertions will be available. This means that one can have code called assertions sprinkled in the code: usually they are optimised away, but they can be enabled with the
-Aoption. (sprinkle sprinkle โจ) - A new operator
//(defined-or) will be available. This means that one will be able to say
$a // $b
instead of
defined $a ? $a : $b
and
$c //= $d;
instead of
$c = $d unless defined $c;
The operator will have the same precedence and associativity as ||. A source code patch against the Perl 5.8.1 sources will be available in CPAN as authors/id/H/HM/HMBRAND/dor-5.8.1.diff. (iykyk ๐)
unpack()will default to unpacking the$_.- Various Copy-On-Write techniques will be investigated in hopes of speeding up Perl. ๐ฆ
- CPANPLUS, Inline, and Module::Build will become core modules. (glow up fr fr)
- The ability to write true lexically scoped pragmas will be introduced.
- Work will continue on the bytecompiler and byteloader.
- v-strings as they currently exist are scheduled to be deprecated. The v-less form (
1.2.3) will become a "version object" when used withuse,require, and$VERSION.$^Vwill also be a "version object" so theprintf("%vd",...)construct will no longer be needed. The v-ful version (v1.2.3) will become obsolete. The equivalence of strings and v-strings (e.g. that currently5.8.0is equal to"\5\8\0") will go away. There may be no deprecation warning for v-strings, though: it is quite hard to detect when v-strings are being used safely, and when they are not. ๐ - 5.005 Threads Will Be Removed ๐ชฆ
- The
$*Variable Will Be Removed (it was deprecated a long time ago) - Pseudohashes Will Be Removed ๐ซถ
๐ Reporting Bugs ๐
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://bugs.perl.org/. There may also be information at http://www.perl.com/, the Perl Home Page. (do ur research first bestie, we beg ๐)
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. this part is SO important โ a tiny but sufficient test case is the whole vibe 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. You can browse and search the Perl 5 bugs at http://bugs.perl.org/ ๐ธ
๐ SEE ALSO ๐
- The
Changesfile for exhaustive details on what changed. (the receipts ๐) - The
INSTALLfile for how to build Perl. ๐ง - The
READMEfile for general stuff. ๐ - The
ArtisticandCopyingfiles for copyright information. โ๏ธ
okay bestie that's a wrap on this whole delta page ๐ you read the entire thing, which is genuinely iconic of you, no cap ๐ this was perl version v5.42.3, dated 2026-08-03, and it's the PERL581DELTA(1) page โ so go forth, be the main character of your own codebase, and remember: perl is forever, and so are you ๐โจ๐ฆ
๐ฆ where this page comes from
- fedora 43: perl-doc 5.42.3-524.fc43 ยท (GPL-1.0-or-later OR Artistic-1.0-Perl) AND Unicode-3.0 AND LicenseRef-Fedora-UltraPermissive
- fedora 44: perl-doc 5.42.3-525.fc44 ยท (GPL-1.0-or-later OR Artistic-1.0-Perl) AND Unicode-3.0 AND LicenseRef-Fedora-UltraPermissive
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms