From 4f1684ad2bc9346e902379ee350a3ca8a1d39b7d Mon Sep 17 00:00:00 2001 From: Ricardo Signes Date: Sun, 26 Apr 2015 18:12:35 -0400 Subject: perldelta group core enhancements by topic area --- Porting/perl5220delta.pod | 216 +++++++++++++++++++++++----------------------- 1 file changed, 106 insertions(+), 110 deletions(-) (limited to 'Porting') diff --git a/Porting/perl5220delta.pod b/Porting/perl5220delta.pod index 767512cb5e..d4709a7c2d 100644 --- a/Porting/perl5220delta.pod +++ b/Porting/perl5220delta.pod @@ -18,7 +18,27 @@ XXX Any important notices here =head1 Core Enhancements -=head2 qr/\b{gcb}/ is now handled in regular expressions +=head2 New bitwise operators + +A new experimental facility has been added that makes the four standard +bitwise operators (C<& | ^ ~>) treat their operands consistently as +numbers, and introduces four new dotted operators (C<&. |. ^. ~.>) that +treat their operands consistently as strings. The same applies to the +assignment variants (C<&= |= ^= &.= |.= ^.=>). + +To use this, enable the "bitwise" feature and disable the +"experimental::bitwise" warnings category. See L for details. [rt.perl.org #123466] + +=head2 New double-diamond operator + +C<<< <<>> >>> is like C<< <> >> but uses three-argument C to open +each file in @ARGV. So each element of @ARGV is an actual file name, and +"|foo" won't be treated as a pipe open. + +=head2 New \b boundaries in regular expressions + +=head3 qr/\b{gcb}/ C stands for Grapheme Cluster Boundary. It is a Unicode property that finds the boundary between sequences of characters that look like a @@ -27,7 +47,7 @@ the ability to deal with these through the C<\X> regular escape sequence. Now, there is an alternative way of handling these. See L for details. -=head2 qr/\b{wb}/ is now handled in regular expressions +=head3 qr/\b{wb}/ C stands for Word Boundary. It is a Unicode property that finds the boundary between words. This is similar to the plain @@ -35,24 +55,12 @@ C<\b> (without braces) but is more suitable for natural language processing. It knows, for example that apostrophes can occur in the middle of words. See L for details. -=head2 qr/\b{sb}/ is now handled in regular expressions +=head3 qr/\b{sb}/ C stands for Sentence Boundary. It is a Unicode property to aid in parsing natural language sentences. See L for details. -=head2 New bitwise operators - -A new experimental facility has been added that makes the four standard -bitwise operators (C<& | ^ ~>) treat their operands consistently as -numbers, and introduces four new dotted operators (C<&. |. ^. ~.>) that -treat their operands consistently as strings. The same applies to the -assignment variants (C<&= |= ^= &.= |.= ^.=>). - -To use this, enable the "bitwise" feature and disable the -"experimental::bitwise" warnings category. See L for details. [rt.perl.org #123466] - =head2 C covers more and is lexical Previously running C would only turn off a few things. Now it @@ -70,10 +78,6 @@ This is equivalent to putting C at the beginning of every capturing group. See L for more information. -=head2 C with no arguments - -C with no arguments now infers C<$_>. [perl #123514] - =head2 C This applies stricter syntax rules to regular expression patterns @@ -85,6 +89,74 @@ experience, using this pragma will raise a category C warning. See L<'strict' in re|re/'strict' mode>. +=head2 C now ignores any Unicode pattern white space + +The C regular expression modifier allows the pattern to contain +white space and comments, both of which are ignored, for improved +readability. Until now, not all the white space characters that Unicode +designates for this purpose were handled. The additional ones now +recognized are +U+0085 NEXT LINE, +U+200E LEFT-TO-RIGHT MARK, +U+200F RIGHT-TO-LEFT MARK, +U+2028 LINE SEPARATOR, +and +U+2029 PARAGRAPH SEPARATOR. + +=head2 Unicode 7.0 is now supported + +For details on what is in this release, see +L. + +=head2 S> can restrict which locale categories are affected + +It is now possible to pass a parameter to S> to specify +a subset of locale categories to be locale-aware, with the remaining +ones unaffected. See L for details. + +=head2 Perl now supports POSIX 2008 locale currency additions. + +On platforms that are able to handle POSIX.1-2008, the +hash returned by +L|perllocale/The localeconv function> +includes the international currency fields added by that version of the +POSIX standard. These are +C, +C, +C, +C, +C, +and +C. + +=head2 Better heuristics on older platforms for determining locale UTF8ness + +On platforms that implement neither the C99 standard nor the POSIX 2001 +standard, determining if the current locale is UTF8 or not depends on +heuristics. These are improved in this release. + +=head2 Aliasing via reference + +Variables and subroutines can now be aliased by assigning to a reference: + + \$c = \$d; + \&x = \&y; + +Or by using a backslash before a C iterator variable, which is +perhaps the most useful idiom this feature provides: + + foreach \%hash (@array_of_hash_refs) { ... } + +This feature is experimental and must be enabled via C. It will warn unless the C +warnings category is disabled. + +See L + +=head2 C with no arguments + +C with no arguments now infers C<$_>. [perl #123514] + =head2 New "const" subroutine attribute The "const" attribute can be applied to an anonymous subroutine. It causes @@ -104,17 +176,6 @@ indicate that the operation is not supported. Currently, this uses either a C member in the OS C structure, or a dirfd(3) function as specified by POSIX.1-2008. -=head2 Unicode 7.0 is now supported - -For details on what is in this release, see -L. - -=head2 Better heuristics on older platforms for determining locale UTF8ness - -On platforms that implement neither the C99 standard nor the POSIX 2001 -standard, determining if the current locale is UTF8 or not depends on -heuristics. These are improved in this release. - =head2 List form of pipe open implemented for Win32 The list form of pipe: @@ -125,12 +186,6 @@ is now implemented on Win32. It has the same limitations as C on Win32, since the Win32 API doesn't accept program arguments as a list. -=head2 Assignment to list repetition - -C<(...) x ...> can now be used within a list that is assigned to, as long -as the left-hand side is a valid lvalue. This allows C<(undef,undef,$foo) -= that_function()> to be written as C<((undef)x2, $foo) = that_function()>. - =head2 C now sets C<$!> When an I/O error occurs, the fact that there has been an error is recorded @@ -139,6 +194,11 @@ value of C<$!> would be untouched by C, so the common convention of writing C did not work reliably. Now the handle records the value of C<$!>, too, and C restores it. +=head2 Assignment to list repetition + +C<(...) x ...> can now be used within a list that is assigned to, as long +as the left-hand side is a valid lvalue. This allows C<(undef,undef,$foo) += that_function()> to be written as C<((undef)x2, $foo) = that_function()>. =head2 Infinity and NaN (not-a-number) handling improved @@ -157,6 +217,16 @@ As a completely new feature, hexadecimal floating point literals (like 0x1.23p-4) are now supported, and they can be output with C. +=head2 Packing infinity or not-a-number into a character is now fatal + +Before, when trying to pack infinity or not-a-number into a +(signed) character, Perl would warn, and assumed you tried to +pack C<< 0xFF >>; if you gave it as an argument to C<< chr >>, +C<< U+FFFD >> was returned. + +But now, all such actions (C<< pack >>, C<< chr >>, and C<< print '%c' >>) +result in a fatal error. + =head2 Experimental C Backtrace API Starting from Perl 5.21.1, on some platforms Perl supports retrieving @@ -175,80 +245,6 @@ Also included is a C API to retrieve backtraces. See L for more information. -=head2 C now ignores any Unicode pattern white space - -The C regular expression modifier allows the pattern to contain -white space and comments, both of which are ignored, for improved -readability. Until now, not all the white space characters that Unicode -designates for this purpose were handled. The additional ones now -recognized are -U+0085 NEXT LINE, -U+200E LEFT-TO-RIGHT MARK, -U+200F RIGHT-TO-LEFT MARK, -U+2028 LINE SEPARATOR, -and -U+2029 PARAGRAPH SEPARATOR. - -=head2 S> can restrict which locale categories are affected - -It is now possible to pass a parameter to S> to specify -a subset of locale categories to be locale-aware, with the remaining -ones unaffected. See L for details. - -=head2 New double-diamond operator - -C<<< <<>> >>> is like C<< <> >> but uses three-argument C to open -each file in @ARGV. So each element of @ARGV is an actual file name, and -"|foo" won't be treated as a pipe open. - -=head2 Aliasing via reference - -Variables and subroutines can now be aliased by assigning to a reference: - - \$c = \$d; - \&x = \&y; - -Or by using a backslash before a C iterator variable, which is -perhaps the most useful idiom this feature provides: - - foreach \%hash (@array_of_hash_refs) { ... } - -This feature is experimental and must be enabled via C. It will warn unless the C -warnings category is disabled. - -See L - -=head2 Perl now supports POSIX 2008 locale currency additions. - -On platforms that are able to handle POSIX.1-2008, the -hash returned by -L|perllocale/The localeconv function> -includes the international currency fields added by that version of the -POSIX standard. These are -C, -C, -C, -C, -C, -and -C. - -=head2 Packing infinity or not-a-number into a character is now fatal - -Before, when trying to pack infinity or not-a-number into a -(signed) character, Perl would warn, and assumed you tried to -pack C<< 0xFF >>; if you gave it as an argument to C<< chr >>, -C<< U+FFFD >> was returned. - -But now, all such actions (C<< pack >>, C<< chr >>, and C<< print '%c' >>) -result in a fatal error. - -=head2 Inf and NaN - -Many small improvements, bug fixes and added test cases for dealing -with math related to infinity and not-a-number. - =head1 Security =head2 Perl is now compiled with -fstack-protector-strong if available -- cgit v1.2.1