=encoding utf8
=head1 NAME
perl5100delta - what is new for perl 5.10.0
=head1 DESCRIPTION
This document describes the differences between the 5.8.8 release and
the 5.10.0 release.
Many of the bug fixes in 5.10.0 were already seen in the 5.8.X maintenance
releases; they are not duplicated here and are documented in the set of
man pages named perl58[1-8]?delta.
=head1 Core Enhancements
=head2 The C pragma
The C pragma is used to enable new syntax that would break Perl's
backwards-compatibility with older releases of the language. It's a lexical
pragma, like C or C.
Currently the following new features are available: C (adds a
switch statement), C (adds a C built-in function), and C
(adds a C keyword for declaring "static" variables). Those
features are described in their own sections of this document.
The C pragma is also implicitly loaded when you require a minimal
perl version (with the C
for regular expressions. Using this
makes the engine preserve a copy of the part of the matched string before
the matching substring to the new special variable C<${^PREMATCH}>, the
part after the matching substring to C<${^POSTMATCH}>, and the matched
substring itself to C<${^MATCH}>.
Perl is still able to store these substrings to the special variables
C<$`>, C<$'>, C<$&>, but using these variables anywhere in the program
adds a penalty to all regular expression matches, whereas if you use
the C flag and the new special variables instead, you pay only for
the regular expressions where the flag is used.
For more detail on the new variables, see L; for the use of
the regular expression flag, see L and L.
=back
=head2 C
say() is a new built-in, only available when C is in
effect, that is similar to print(), but that implicitly appends a newline
to the printed string. See L. (Robin Houston)
=head2 Lexical C<$_>
The default variable C<$_> can now be lexicalized, by declaring it like
any other lexical variable, with a simple
my $_;
The operations that default on C<$_> will use the lexically-scoped
version of C<$_> when it exists, instead of the global C<$_>.
In a C