In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/bd9cbc460bc6144f7e4cfc82772b389efe6331e3?hp=24391d948c819e010d884e51f3670ebcfb762ecd>
- Log ----------------------------------------------------------------- commit bd9cbc460bc6144f7e4cfc82772b389efe6331e3 Author: Father Chrysostomos <spr...@cpan.org> Date: Sat Apr 7 23:10:27 2012 -0700 perl5160delta.pod: Add to-do note M Porting/perl5160delta.pod commit 4ad239c380810e68055f79a3d533bf9925e0c36b Author: Father Chrysostomos <spr...@cpan.org> Date: Sat Apr 7 22:58:11 2012 -0700 perl5160delta.pod: Lvalue sub bugfix section Move all lv sub bug fixes into this section. Tweak things a bit. M Porting/perl5160delta.pod commit 801284b18d8b02a0f5186cee00f8aca107a8769e Author: Father Chrysostomos <spr...@cpan.org> Date: Sat Apr 7 22:57:41 2012 -0700 perl5160delta.pod: Missing space M Porting/perl5160delta.pod commit a4b685792c70f00704afcf6d9c5b5f739b805b49 Author: Father Chrysostomos <spr...@cpan.org> Date: Sat Apr 7 19:04:58 2012 -0700 perl5160delta.pod: Rewording M Porting/perl5160delta.pod commit 1154aa6dd5fb009c903916423128dfd0def36c87 Author: Father Chrysostomos <spr...@cpan.org> Date: Sat Apr 7 19:01:07 2012 -0700 perl5160delta.pod: Make diag changes somewhat alphabetical Alphabetized mostly by the text of the error message, even when it is not given. M Porting/perl5160delta.pod commit 98a0da084d51929cd21424e6a4605eb1b9517a39 Author: Father Chrysostomos <spr...@cpan.org> Date: Sat Apr 7 18:57:39 2012 -0700 perl5160delta.pod: Alphabetize new diagnostics M Porting/perl5160delta.pod commit d0af4845afd5a73ca6710a2b51fef47511469e79 Author: Father Chrysostomos <spr...@cpan.org> Date: Sat Apr 7 18:56:01 2012 -0700 perl5160delta.pod: Note that zipdetails is new M Porting/perl5160delta.pod commit e72df1c16a12d6d4a8053b5424bb43d04dd5f343 Author: Father Chrysostomos <spr...@cpan.org> Date: Sat Apr 7 18:54:42 2012 -0700 perl5160delta.pod: Typos M Porting/perl5160delta.pod commit 9f6b5e9dd5eb94f1b519cbe92ffaab4cb15ed7ea Author: Father Chrysostomos <spr...@cpan.org> Date: Sat Apr 7 18:52:17 2012 -0700 perl5160delta.pod: Move âglob failedâ under Diagnostics M Porting/perl5160delta.pod commit 482daec9e7e54547bdec16fe42dda265c8766400 Author: Father Chrysostomos <spr...@cpan.org> Date: Sat Apr 7 18:50:30 2012 -0700 perl5160delta.pod: Removed Errors, not Warnings The only removed diagnostic was an error. M Porting/perl5160delta.pod commit 91d325b279fb9a7533bad179bc37162cb180f7b3 Author: Father Chrysostomos <spr...@cpan.org> Date: Sat Apr 7 18:49:13 2012 -0700 perl5160delta.pod: Donât list $[ deprecation msg It was inadvertently removed and later restored, both in the 5.15.x series. M Porting/perl5160delta.pod commit b982ce39b1ea1ac682d5ef04179f27829b177e03 Author: Father Chrysostomos <spr...@cpan.org> Date: Sat Apr 7 18:48:06 2012 -0700 perl5160delta.pod: Shorten $[ warning description That last sentence is unnecessary. M Porting/perl5160delta.pod commit ee1214f2413bb33489b5867803cfe05e8c5bc185 Author: Father Chrysostomos <spr...@cpan.org> Date: Sat Apr 7 18:47:06 2012 -0700 perl5160delta.pod: âUseless assignmentâ rewording It actually happens with any lvalue subroutines, not just XS, as in â+sub :lvalue { my $foo }->() = 3â. M Porting/perl5160delta.pod commit 10c3c9ec67ea57d6fcae1113a537c60629a0d556 Author: Father Chrysostomos <spr...@cpan.org> Date: Sat Apr 7 18:43:53 2012 -0700 perl5160delta.pod: Format new errors consistently M Porting/perl5160delta.pod ----------------------------------------------------------------------- Summary of changes: Porting/perl5160delta.pod | 252 ++++++++++++++++++++------------------------- 1 files changed, 113 insertions(+), 139 deletions(-) diff --git a/Porting/perl5160delta.pod b/Porting/perl5160delta.pod index db89d13..682b8a7 100644 --- a/Porting/perl5160delta.pod +++ b/Porting/perl5160delta.pod @@ -1341,23 +1341,20 @@ tying a special array like C<@_>. You should never see this message. =item * -L<Source filters apply only to byte streams|perldiag/"Source filters apply only to byte streams"> - -This new error occurs when you try to activate a source filter (usually by -loading a source filter module) within a string passed to C<eval> under the -C<unicode_eval> feature. - -=item * - L<&CORE::%s cannot be called directly|perldiag/"&CORE::%s cannot be called directly"> -(F) You tried to call a subroutine in the C<CORE::> namespace +This occurs when a subroutine in the C<CORE::> namespace is called with C<&foo> syntax or through a reference. Some subroutines in this package cannot yet be called that way, but must be -called as barewords. Something like this will work: +called as barewords. See L</Subroutines in the C<CORE> namespace>, above. + +=item * - BEGIN { *shove = \&CORE::push; } - shove @array, 1,2,3; # pushes on to @array +L<Source filters apply only to byte streams|perldiag/"Source filters apply only to byte streams"> + +This new error occurs when you try to activate a source filter (usually by +loading a source filter module) within a string passed to C<eval> under the +C<unicode_eval> feature. =back @@ -1374,58 +1371,51 @@ Previously it only issued a warning for lexical variables. =item * -L<Useless use of \E|perldiag/"Useless use of \E"> - -C<\E> does nothing unless preceded by C<\Q>, C<\L> or C<\U>. - -=item * - -L<overload arg '%s' is invalid|perldiag/"overload arg '%s' is invalid"> +L<length() used on %s|perldiag/length() used on %s> -This warning, in the "overload" category, is produced when the overload -pragma is given an argument it doesn't recognize, presumably a mistyped -operator. +This new warning occurs when C<length> is used on an array or hash, instead +of C<scalar(@array)> or C<scalar(keys %hash)>. =item * -L<Useless assignment to a temporary|perldiag/"Useless assignment to a temporary"> +L<lvalue attribute %s already-defined subroutine|perldiag/"lvalue attribute %s already-defined subroutine"> -Assigning to a temporary returned from an XS lvalue subroutine now produces a -warning [perl #31946]. +L<attributes.pm|attributes> now emits this warning when the :lvalue +attribute is applied to a Perl subroutine that has already been defined, as +doing so can have unexpected side-effects. =item * -L<length() used on %s|perldiag/length() used on %s> +L<overload arg '%s' is invalid|perldiag/"overload arg '%s' is invalid"> -This new warning occurs when C<length> is used on an array or hash, instead -of C<scalar(@array)> or C<scalar(keys %hash)>. +This warning, in the "overload" category, is produced when the overload +pragma is given an argument it doesn't recognize, presumably a mistyped +operator. =item * L<$[ used in %s (did you mean $] ?)|perldiag/"$[ used in %s (did you mean $] ?)"> This new warning exists to catch the mistaken use of C<$[> in version -checks. C<$]>, not C<$[>, contains the version number. C<$[> in a numeric -comparison is almost always wrong. +checks. C<$]>, not C<$[>, contains the version number. =item * -L<Use of assignment to $[ is deprecated|perldiag/"Use of assignment to $[ is deprecated"> +L<Useless assignment to a temporary|perldiag/"Useless assignment to a temporary"> -This previously removed warning has been restored with the re-implementation -of C<$[> as a module. +Assigning to a temporary scalar returned +from an lvalue subroutine now produces this +warning [perl #31946]. =item * -L<lvalue attribute %s already-defined subroutine|perldiag/"lvalue attribute %s already-defined subroutine"> +L<Useless use of \E|perldiag/"Useless use of \E"> -L<attributes.pm|attributes> now emits this warning when the :lvalue -attribute is applied to a Perl subroutine that has already been defined, as -doing so can have unexpected side-effects. +C<\E> does nothing unless preceded by C<\Q>, C<\L> or C<\U>. =back -=head2 Removed Warnings +=head2 Removed Errors =over @@ -1449,9 +1439,9 @@ where it was already allowed [perl #90030]. =item * -Redefinition warnings for constant subroutines used to be mandatory, -even occurring under C<no warnings>. Now they respect the L<warnings> -pragma. +The "Applying pattern match..." or similar warning produced when an +array or hash is on the left-hand side of the C<=~> operator now +mentions the name of the variable. =item * @@ -1461,12 +1451,6 @@ with the correct spelling in L<perldiag>. =item * -The 'Use of "foo" without parentheses is ambiguous' warning has been -extended to apply also to user-defined subroutines with a (;$) -prototype, and not just to built-in functions. - -=item * - The error messages for using C<default> and C<when> outside of a topicalizer have been standardised to match the messages for C<continue> and loop controls. They now read 'Can't "default" outside a @@ -1475,15 +1459,20 @@ to be 'Can't use when() outside a topicalizer' [perl #91514]. =item * -The uninitialized warning for C<y///r> when C<$_> is implicit and -undefined now mentions the variable name, just like the non-/r variation -of the operator. +The message, "Code point 0x%X is not Unicode, no properties match it; +all inverse properties do" has been changed to "Code point 0x%X is not +Unicode, all \p{} matches fail; all \P{} matches succeed". =item * -The "Applying pattern match..." or similar warning produced when an -array or hash is on the left-hand side of the C<=~> operator now -mentions the name of the variable. +Redefinition warnings for constant subroutines used to be mandatory, +even occurring under C<no warnings>. Now they respect the L<warnings> +pragma. + +=item * + +The "glob failed" warning message is now suppressible via C<no warnings> +[perl #111656]. =item * @@ -1502,9 +1491,15 @@ both. =item * -The message, "Code point 0x%X is not Unicode, no properties match it; -all inverse prop erties do" has been changed to "Code point 0x%X is not -Unicode, all \p{} matches fail; all \P{} matches succeed" +The uninitialized warning for C<y///r> when C<$_> is implicit and +undefined now mentions the variable name, just like the non-/r variation +of the operator. + +=item * + +The 'Use of "foo" without parentheses is ambiguous' warning has been +extended to apply also to user-defined subroutines with a (;$) +prototype, and not just to built-in functions. =item * @@ -1575,6 +1570,9 @@ entries in these cases, instead of simply failing to find the message. =item * +This is a new utility, included as part of an +L<IO::Compress::Base> upgrade. + L<zipdetails> displays information about the internal record structure of the zip file. It is not concerned with displaying any details of the compressed data stored in the zip file. @@ -1881,14 +1879,15 @@ LATIN SMALL LIGATURE ST. =item * -Fixed memory leak regression in regular expression compilation -under threading +A memory leak regression in regular expression compilation +under threading has been fixed. =item * -A regression introduced in 5.13.6 was fixed. This involved an inverted +A regression introduced in 5.13.6 has +been fixed. This involved an inverted bracketed character class in a regular expression that consisted solely -of a Unicode property, that property wasn't getting inverted outside the +of a Unicode property. That property wasn't getting inverted outside the Latin1 range. =back @@ -1902,7 +1901,7 @@ Latin1 range. A number of edge cases have been fixed with formats and C<formline>; in particular, where the format itself is potentially variable (such as with ties and overloading), and where the format and data differ in their -encoding. In both these cases, it used to possible for the output to be +encoding. In both these cases, it used to possible for the output to be corrupted [perl #91032]. =item * @@ -1951,9 +1950,11 @@ copy-on-write string. L<Storable>, L<Devel::Peek> and L<PerlIO::scalar> had similar problems. See L</Updated Modules and Pragmata>, above. +XXX That section is empty. + =back -=head2 lvalue subroutines +=head2 Lvalue subroutines There have been various fixes to lvalue subroutines. @@ -1964,10 +1965,6 @@ There have been various fixes to lvalue subroutines. Explicit return now returns the actual argument passed to return, instead of copying it [perl #72724, #72706]. -B<Note:> There are still some discrepancies between explicit and implicit -return, which will hopefully be resolved soon. So the exact behaviour is -not set in stone yet. - =item * Lvalue subroutines used to enforce lvalue syntax (i.e., whatever can go on @@ -2002,7 +1999,8 @@ Autovivification now works on values returned from lvalue subroutines =item * -When called in pass-by-reference context (e.g., subroutine arguments or a list +When called in potential lvalue context +(e.g., subroutine arguments or a list passed to C<for>), an lvalue subroutine returning arrays or hashes used to bind the arrays (or hashes) to scalar variables--something that is not supposed to happen. This could result in "Bizarre copy of ARRAY" errors or C<print> @@ -2013,7 +2011,7 @@ more general fix has been applied [perl #23790]. =item * -When called in pass-by-reference context, lvalue subroutines used to copy +When called in potential lvalue context, lvalue subroutines used to copy any read-only value that was returned. E.g., C< sub :lvalue { $] } > would not return C<$]>, but a copy of it. @@ -2035,6 +2033,53 @@ Method calls whose arguments were all surrounded with C<my()> or C<our()> the subroutine. This would prevent lvalue methods from returning certain values. +=item * + +Lvalue sub calls that are not determined to be such at compile time +(C<&$name> or &{"name"}) are no longer exempt from strict refs if they +occur in the last statement of an lvalue subroutine [perl #102486]. + +=item * + +Sub calls whose subs are not visible at compile time, if +they occurred in the last statement of an lvalue subroutine, +would reject non-lvalue subroutines and die with "Can't modify non-lvalue +subroutine call" [perl #102486]. + +Non-lvalue sub calls whose subs I<are> visible at compile time exhibited +the opposite bug. If the call occurred in the last statement of an lvalue +subroutine, there would be no error when the lvalue sub was called in +lvalue context. Perl would blindly assign to the temporary value returned +by the non-lvalue subroutine. + +=item * + +C<AUTOLOAD> routines used to take precedence over the actual sub being +called (i.e., when autoloading wasn't needed), for sub calls in lvalue or +potential lvalue context, if the subroutine was not visible at compile +time. + +=item * + +Applying the :lvalue attribute to subroutine that is already defined does +not work properly, as the attribute changes the way the sub is compiled. +Hence, Perl 5.12 began warning when an attempt is made to apply the +attribute to an already defined sub. In such cases, the attribute is +discarded. + +But the change in 5.12 missed the case where custom attributes are also +present: that case still silently and ineffectively applied the attribute. +That omission has now been corrected. C<sub foo :lvalue :Whatever> (when +C<foo> is already defined) now warns about the :lvalue attribute, and does +not apply it. + +=item * + +A bug affecting lvalue context propagation through nested lvalue subroutine +calls has been fixed. Previously, returning a value in nested rvalue +context would be treated as lvalue context by the inner subroutine call, +resulting in some values (such as read-only values) being rejected. + =back =head2 Fixes related to hashes @@ -2255,38 +2300,6 @@ for flat scalars (i.e., not references). =item * -Lvalue subs and strict mode - -Lvalue sub calls that are not determined to be such at compile time -(C<&$name> or &{"name"}) are no longer exempt from strict refs if they -occur in the last statement of an lvalue subroutine [perl #102486]. - -=item * - -Non-lvalue sub calls in potentially lvalue context - -Sub calls whose subs are not visible at compile time, if -they occurred in the last statement of an lvalue subroutine, -would reject non-lvalue subroutines and die with "Can't modify non-lvalue -subroutine call" [perl #102486]. - -Non-lvalue sub calls whose subs I<are> visible at compile time exhibited -the opposite bug. If the call occurred in the last statement of an lvalue -subroutine, there would be no error when the lvalue sub was called in -lvalue context. Perl would blindly assign to the temporary value returned -by the non-lvalue subroutine. - -=item * - -AUTOLOADing lvalue subs - -C<AUTOLOAD> routines used to take precedence over the actual sub being -called (i.e., when autoloading wasn't needed), for sub calls in lvalue or -potential lvalue context, if the subroutine was not visible at compile -time. - -=item * - C<caller> and tied C<@DB::args> C<caller> sets C<@DB::args> to the subroutine arguments when called from @@ -3111,33 +3124,6 @@ reference to C<$x>. This has been fixed [perl #91844]. =item * -Applying the :lvalue attribute to subroutine that is already defined does -not work properly, as the attribute changes the way the sub is compiled. -Hence, Perl 5.12 began warning when an attempt is made to apply the -attribute to an already defined sub. In such cases, the attribute is -discarded. - -But the change in 5.12 missed the case where custom attributes are also -present: that case still silently and ineffectively applied the attribute. -That omission has now been corrected. C<sub foo :lvalue :Whatever> (when -C<foo> is already defined) now warns about the :lvalue attribute, and does -not apply it. - -L<attributes.pm|attributes> has likewise been updated to warn and not apply -the attribute. - -=item * - -The remaining discrepancies between explicit and implicit return from -lvalue subroutines have been resolved. They mainly involved which error -message to display when a read-only value is returned in lvalue context. -Also, returning a PADTMP (the result of most built-ins, like C<index>) in -lvalue context is now forbidden for explicit return, as it always has been -for implicit return. This is not a regression from 5.14, as all the cases -in which it could happen where previously syntax errors. - -=item * - The C<prototype> function no longer dies for the C<__FILE__>, C<__LINE__> and C<__PACKAGE__> directives. It now returns an empty-string prototype for them, because they are syntactically very similar to nullary functions @@ -3152,13 +3138,6 @@ It used to return incorrect prototypes for some and die for others =item * -A bug affecting lvalue context propagation through nested lvalue subroutine -calls has been fixed. Previously, returning a value in nested rvalue -context would be treated as lvalue context by the inner subroutine call, -resulting in some values (such as read-only values) being rejected. - -=item * - Some core bugs affecting L<Hash::Util> have been fixed: locking a hash element that is a glob copy no longer causes subsequent assignment to it to corrupt the glob, and unlocking a hash element that holds a copy-on-write @@ -3523,11 +3502,6 @@ The trie optimisation used to have problems with alternations containing an empty C<(?:)>, causing C<< "x" =~ /\A(?>(?:(?:)A|B|C?x))\z/ >> not to match, whereas it should [perl #111842]. -=item * - -The "glob failed" warning message is now suppressible via C<no warnings> -[perl #111656]. - =back =head1 Known Problems -- Perl5 Master Repository