=head2 Defined-or operator
A new operator C<//> (defined-or) has been implemented.
-The following statement:
+The following expression:
$a // $b
defined $a ? $a : $b
-and
+and the statement
$c //= $d;
$ # end of line
/x
-Note, users experienced with PCRE will find that the Perl implementation
-of this feature differs from the PCRE one in that it is possible to
-backtrack into a recursed pattern, whereas in PCRE the recursion is
-atomic or "possessive" in nature. (Yves Orton)
+PCRE users should note that Perl's recursive regex feature allows
+backtracking into a recursed pattern, whereas in PCRE the recursion is
+atomic or "possessive" in nature. As in the example above, you can
+add (?>) to control this selectively. (Yves Orton)
=item Named Capture Buffers
syntax. In code, the new magical hashes C<%+> and C<%-> can be used to
access the contents of the capture buffers.
-Thus, to replace all doubled chars, one could write
+Thus, to replace all doubled chars with a single copy, one could write
s/(?<letter>.)\k<letter>/$+{letter}/g
=item C<\K> escape
The functionality of Jeff Pinyan's module Regexp::Keep has been added to
-the core. You can now use in regular expressions the special escape C<\K>
+the core. In regular expressions you can now use the special escape C<\K>
as a way to do something like floating length positive lookbehind. It is
also useful in substitutions like:
=head2 The C<_> prototype
-A new prototype character has been added. C<_> is equivalent to C<$> (it
-denotes a scalar), but defaults to C<$_> if the corresponding argument
-isn't supplied. Due to the optional nature of the argument, you can only
-use it at the end of a prototype, or before a semicolon.
+A new prototype character has been added. C<_> is equivalent to C<$> but
+defaults to C<$_> if the corresponding argument isn't supplied. (both C<$>
+and C<_> denote a scalar). Due to the optional nature of the argument, you
+can only use it at the end of a prototype, or before a semicolon.
This has a small incompatible consequence: the prototype() function has
been adjusted to return C<_> for some built-ins in appropriate cases (for
A new pragma, C<mro> (for Method Resolution Order) has been added. It
permits to switch, on a per-class basis, the algorithm that perl uses to
-find inherited methods in case of a mutiple inheritance hierachy. The
+find inherited methods in case of a multiple inheritance hierarchy. The
default MRO hasn't changed (DFS, for Depth First Search). Another MRO is
available: the C3 algorithm. See L<mro> for more information.
(Brandon Black)
-Note that, due to changes in the implentation of class hierarchy search,
+Note that, due to changes in the implementation of class hierarchy search,
code that used to undef the C<*ISA> glob will most probably break. Anyway,
undef'ing C<*ISA> had the side-effect of removing the magic on the @ISA
array and should not have been done in the first place.
To use state variables, one needs to enable them by using
- use feature "state";
+ use feature 'state';
or by using the C<-E> command-line switch in one-liners.
See L<perlsub/"Persistent variables via state()">.
See L<< UNIVERSAL/"$obj->DOES( ROLE )" >>.
-=head2 C<CLONE_SKIP()>
-
-Perl has now support for the C<CLONE_SKIP> special subroutine. Like
-C<CLONE>, C<CLONE_SKIP> is called once per package; however, it is called
-just before cloning starts, and in the context of the parent thread. If it
-returns a true value, then no objects of that class will be cloned. See
-L<perlmod> for details. (Contributed by Dave Mitchell.)
-
=head2 Formats
Formats were improved in several ways. A new field, C<^*>, can be used for
The constant folding routine is now wrapped in an exception handler, and
if folding throws an exception (such as attempting to evaluate 0/0), perl
now retains the current optree, rather than aborting the whole program.
-(Nicholas Clark, Dave Mitchell)
+Without this change, programs would not compile if they had expressions that
+happened to generate exceptions, even though those expressions were in code
+that could never be reached at runtime. (Nicholas Clark, Dave Mitchell)
=head2 Source filters in @INC
=head2 MAD
-MAD, which stands for I<Misc Attribute Decoration>, is a
+MAD, which stands for I<Miscellaneous Attribute Decoration>, is a
still-in-development work leading to a Perl 5 to Perl 6 converter. To
enable it, it's necessary to pass the argument C<-Dmad> to Configure. The
-obtained perl isn't binary compatible with a regular perl 5.9.4, and has
+obtained perl isn't binary compatible with a regular perl 5.10, and has
space and speed penalties; moreover not all regression tests still pass
with it. (Larry Wall, Nicholas Clark)
+=head2 kill() on Windows
+
+On Windows platforms, C<kill(-9, $pid)> now kills a process tree.
+(On UNIX, this delivers the signal to all processes in the same process
+group.)
+
=head1 Incompatible Changes
=head2 Packing and UTF-8 strings
that the data is to be processed in character mode, i.e. character by
character; on the contrary, C<U0> in unpack() indicates UTF-8 mode, where
the packed string is processed in its UTF-8-encoded Unicode form on a byte
-by byte basis. This is reversed with regard to perl 5.8.X.
+by byte basis. This is reversed with regard to perl 5.8.X, but now consistent
+between pack() and unpack().
Moreover, C<C0> and C<U0> can also be used in pack() templates to specify
respectively character and byte modes.
=head2 strictures and dereferencing in defined()
-C<use strict "refs"> was ignoring taking a hard reference in an argument
+C<use strict 'refs'> was ignoring taking a hard reference in an argument
to defined(), as in :
- use strict "refs";
- my $x = "foo";
+ use strict 'refs';
+ my $x = 'foo';
if (defined $$x) {...}
This now correctly produces the run-time error C<Can't use string as a
=head2 Removal of the JPL
-The JPL (Java-Perl Linguo) has been removed from the perl sources tarball.
+The JPL (Java-Perl Lingo) has been removed from the perl sources tarball.
=head2 Recursive inheritance detected earlier
C<strict> and C<warnings> will now complain loudly if they are loaded via
incorrect casing (as in C<use Strict;>). (Johan Vromans)
+=item C<version>
+
+The C<version> module provides support for version objects.
+
=item C<warnings>
The C<warnings> pragma doesn't load C<Carp> anymore. That means that code
use warnings;
require Carp;
- Carp::confess "argh";
+ Carp::confess 'argh';
=item C<less>
It can also display the parent inheritance tree of a given class, with the
C<i> command.
-Perl has a new -dt command-line flag, which enables threads support in the
-debugger.
-
=item ptar
C<ptar> is a pure perl implementation of C<tar>, that comes with
=item ptardiff
-C<ptardiff> is a small script used to generate a diff between the contents
+C<ptardiff> is a small utility used to generate a diff between the contents
of a tar archive and a directory tree. Like C<ptar>, it comes with
C<Archive::Tar>.
=item h2ph and h2xs
-C<h2ph> and C<h2xs> have been made a bit more robust with regard to
+C<h2ph> and C<h2xs> have been made more robust with regard to
"modern" C code.
C<h2xs> implements a new option C<--use-xsloader> to force use of
=item cpanp
-C<cpanp>, the CPANPLUS shell, has been added. (C<cpanp-run-perl>, an
+C<cpanp>, the CPANPLUS shell, has been added. (C<cpanp-run-perl>, a
helper for CPANPLUS operation, has been added too, but isn't intended for
direct use).
The L<perlreguts> manpage, courtesy of Yves Orton, describes internals of the
Perl regular expression engine.
+The L<perlreapi> manpage describes the interface to the perl interpreter
+used to write pluggable regular expression engines (by Ævar Arnfjörð
+Bjarmason).
+
The L<perlunitut> manpage is an tutorial for programming with Unicode and
string encodings in Perl, courtesy of Juerd Waalboer.
A new manual page, L<perlunifaq> (the Perl Unicode FAQ), has been added
(Juerd Waalboer).
+The L<perlcommunity> manpage gives a description of the Perl community
+on the Internet and in real life. (Edgar "Trizor" Bering)
+
The L<CORE> manual page documents the C<CORE::> namespace. (Tels)
The long-existing feature of C</(?{...})/> regexps setting C<$_> and pos()
B<Note:> Much code exists that works around perl's historic poor
performance on alternations. Often the tricks used to do so will disable
the new optimisations. Hopefully the utility modules used for this purpose
-will be educated about these new optimisations by the time 5.10 is
-released.
+will be educated about these new optimisations.
=item Aho-Corasick start-point optimisation
When a pattern starts with a trie-able alternation and there aren't
-better optimisations available the regex engine will use Aho-Corasick
+better optimisations available, the regex engine will use Aho-Corasick
matching to find the start point. (Yves Orton)
=back
with various C++ compilers (although the situation is not perfect with
some of the compilers on some of the platforms tested.)
-=item Building XS extensions on Windows
-
-Support for building XS extension modules with the free MinGW compiler has
-been improved in the case where perl itself was built with the Microsoft
-VC++ compiler. (ActiveState)
-
=item Support for Microsoft 64-bit compiler
Support for building perl with Microsoft's 64-bit compiler has been
=item Visual C++
-Perl now can be compiled with Microsoft Visual C++.
+Perl can now be compiled with Microsoft Visual C++ 2005 (and 2008 Beta 2).
=item Win32 builds
The VMS port has been improved. See L<perlvms>.
-Support for Cray XT4 Catamount/Qk has been added.
+Support for Cray XT4 Catamount/Qk has been added. See
+F<hints/catamount.sh> in the source code distribution for more
+information.
Vendor patches have been merged for RedHat and Gentoo.
=item PERLIO_DEBUG
-The C<PERLIO_DEBUG> environment variable has no longer any effect for
+The C<PERLIO_DEBUG> environment variable no longer has any effect for
setuid scripts and for scripts run with B<-T>.
Moreover, with a thread-enabled perl, using C<PERLIO_DEBUG> could lead to
=item C<-t> switch fix
The C<-w> and C<-t> switches can now be used together without messing
-up what categories of warnings are activated or not. (Rafael)
+up which categories of warnings are activated. (Rafael)
=item Duping UTF-8 filehandles
=over 4
+=item Use of uninitialized value
+
+Perl will now try to tell you the name of the variable (if any) that was
+undefined.
+
=item Deprecated use of my() in false conditional
A new deprecation warning, I<Deprecated use of my() in false conditional>,
Perl's command-line switch C<-P> is now deprecated.
+=item v-string in use/require is non-portable
+
+Perl will warn you against potential backwards compatibility problems with
+the C<use VERSION> syntax.
+
=item perl -V
C<perl -V> has several improvements, making it more useable from shell
=head1 Changed Internals
-In general, the source code of perl has been refactored, tied up, and
-optimized in many places. Also, memory management and allocation has been
-improved in a couple of points.
+In general, the source code of perl has been refactored, tidied up,
+and optimized in many places. Also, memory management and allocation
+has been improved in several points.
+
+When compiling the perl core with gcc, as many gcc warning flags are
+turned on as is possible on the platform. (This quest for cleanliness
+doesn't extend to XS code because we cannot guarantee the tidiness of
+code we didn't write.) Similar strictness flags have been added or
+tightened for various other C compilers.
=head2 Reordering of SVt_* constants
ordering. (The inheritance hierarchy of C<B::*> objects has been changed
to reflect this.)
+=head2 Elimination of SVt_PVBM
+
+Related to this, the internal type C<SVt_PVBM> has been been removed. This
+dedicated type of C<SV> was used by the C<index> operator and parts of the
+regexp engine to facilitate fast Boyer-Moore matches. Its use internally has
+been replaced by C<SV>s of type C<SVt_PVGV>.
+
+=head2 New type SVt_BIND
+
+A new type C<SVt_BIND> has been added, in readiness for the project to
+implement Perl 6 on 5. There deliberately is no implementation yet, and
+they cannot yet be created or destroyed.
+
=head2 Removal of CPP symbols
The C preprocessor symbols C<PERL_PM_APIVERSION> and
=head2 Less space is used by ops
The C<BASEOP> structure now uses less space. The C<op_seq> field has been
-removed and replaced by the one-bit fields C<op_opt>. C<op_type> is now 9
+removed and replaced by a single bit bit-field C<op_opt>. C<op_type> is now 9
bits long. (Consequently, the C<B::OP> class doesn't provide an C<seq>
method anymore.)
=head2 $^H and %^H
The implementation of the special variables $^H and %^H has changed, to
-allow implementing lexical pragmas in pure perl.
+allow implementing lexical pragmas in pure Perl.
=head2 B:: modules inheritance changed
instead of 3, now that pp_anonhash and pp_anonlist return a reference to
an hash/array when the op is flagged with OPf_SPECIAL (Nicholas Clark).
-=for p5p XXX have we some docs on how to create regexp engine plugins, since that's now possible ? (perlreguts)
-
-=for p5p XXX new BIND SV type, #29544, #29642
-
=head1 Known Problems
There's still a remaining problem in the implementation of the lexical