develooper Front page | perl.perl5.changes | Postings from January 2012

[perl.git] branch blead, updated. v5.15.6-550-g838cf71

From:
Father Chrysostomos
Date:
January 14, 2012 22:37
Subject:
[perl.git] branch blead, updated. v5.15.6-550-g838cf71
Message ID:
E1RmJi2-0005eb-5x@camel.ams6.corp.booking.com
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/838cf71968bf39e504bb4e0c6379924108ba5784?hp=4ab1eb56da9e51d7afaf7663e76680cf1e618834>

- Log -----------------------------------------------------------------
commit 838cf71968bf39e504bb4e0c6379924108ba5784
Author: Father Chrysostomos <sprout@cpan.org>
Date:   Sat Jan 14 22:35:47 2012 -0800

    perldelta up to 55b5114f4

M	pod/perldelta.pod

commit afb6044893775fdeb26b2c53726e3af1c6b1758f
Author: Hojung Youn <amoc.yn@gmail.com>
Date:   Sun Jan 15 12:03:19 2012 +0900

    [perl #108224] B::Deparse doesn't recognize for continue block
    
    B::Deparse foreach scoping problem was fixed at cf24a84005,
    which was issued at #30504. But B::Deparse was blinded
    temporarily by this commit so that it couldn't recognize
    foreach continue block for a moment.
    
    foreach statement generates 'nextstate', 'stub', 'leave', or
    'scope' root opcode at will when foreach statement is not used
    as a oneline statement modifier. So all the case of opcodes
    should be checked.
    
    Some tests for foreach scoping and continue block are attached.
    
    related: #30504

M	dist/B-Deparse/Deparse.pm
M	dist/B-Deparse/t/deparse.t

commit cadced9f89793cf41f9fc990c0320da059d19b98
Author: Father Chrysostomos <sprout@cpan.org>
Date:   Sat Jan 14 22:05:13 2012 -0800

    perldelta up to 9f71cfe6ef2

M	pod/perldelta.pod
-----------------------------------------------------------------------

Summary of changes:
 dist/B-Deparse/Deparse.pm  |    2 +-
 dist/B-Deparse/t/deparse.t |   44 ++++++++++++++++
 pod/perldelta.pod          |  119 ++++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 161 insertions(+), 4 deletions(-)

diff --git a/dist/B-Deparse/Deparse.pm b/dist/B-Deparse/Deparse.pm
index ec5295e..296be02 100644
--- a/dist/B-Deparse/Deparse.pm
+++ b/dist/B-Deparse/Deparse.pm
@@ -2975,7 +2975,7 @@ sub loop_common {
 	    $var = "\$" . $self->deparse($var, 1);
 	}
 	$body = $kid->first->first->sibling; # skip OP_AND and OP_ITER
-	if (!is_state $body->first and $body->first->name ne "stub") {
+	if (!is_state $body->first and $body->first->name !~ /^(?:stub|leave|scope)$/) {
 	    confess unless $var eq '$_';
 	    $body = $body->first;
 	    return $self->deparse($body, 2) . " foreach ($ary)";
diff --git a/dist/B-Deparse/t/deparse.t b/dist/B-Deparse/t/deparse.t
index 6ede945..2831981 100644
--- a/dist/B-Deparse/t/deparse.t
+++ b/dist/B-Deparse/t/deparse.t
@@ -1080,3 +1080,47 @@ $_ = -(f());
 ####
 # require <binop>
 require 'a' . $1;
+####
+#[perl #30504] foreach-my postfix/prefix difference
+$_ = 'foo' foreach my ($foo1, $bar1, $baz1);
+foreach (my ($foo2, $bar2, $baz2)) { $_ = 'foo' }
+foreach my $i (my ($foo3, $bar3, $baz3)) { $i = 'foo' }
+>>>>
+$_ = 'foo' foreach (my($foo1, $bar1, $baz1));
+foreach $_ (my($foo2, $bar2, $baz2)) {
+    $_ = 'foo';
+}
+foreach my $i (my($foo3, $bar3, $baz3)) {
+    $i = 'foo';
+}
+####
+#[perl #108224] foreach with continue block
+foreach (1 .. 3) { print } continue { print "\n" }
+foreach (1 .. 3) { } continue { }
+foreach my $i (1 .. 3) { print $i } continue { print "\n" }
+foreach my $i (1 .. 3) { } continue { }
+>>>>
+foreach $_ (1 .. 3) {
+    print $_;
+}
+continue {
+    print "\n";
+}
+foreach $_ (1 .. 3) {
+    ();
+}
+continue {
+    ();
+}
+foreach my $i (1 .. 3) {
+    print $i;
+}
+continue {
+    print "\n";
+}
+foreach my $i (1 .. 3) {
+    ();
+}
+continue {
+    ();
+}
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index f6d6673..854779e 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -1,7 +1,7 @@
 =encoding utf8
 
 =for comment
-This has been completed up to 7c2b3c783b, except for:
+This has been completed up to 55b5114f4, except for:
 8629c11317 smueller Escape double-quotes in generated #line directives
 8dc67a69b  shlomif  perl -d: display lines inside subroutines.
 3dfd1b5cd2 leont    Export PerlIOBase_open
@@ -112,6 +112,11 @@ may well be none in a stable release.
 Version declarations with the C<use> keyword (e.g., C<use 5.012>) are now
 faster, as they enable features without loading F<feature.pm>.
 
+=item *
+
+C<local $_> is faster now, as it no longer iterates through magic that it
+is not going to copy anyway.
+
 =back
 
 =head1 Modules and Pragmata
@@ -230,6 +235,22 @@ L<perlfaq> has been upgraded from version 5.0150036 to version 5.0150037.
 
 =item *
 
+L<PerlIO::scalar> has been upgraded from version 0.12 to version 0.13.
+
+(This is the module that implements C<< open $fh, '>', \$scalar >>.)
+
+It no longer assumes during C<seek> that $scalar is a string internally.
+If it didn't crash, it was close to doing so [perl #92706].
+
+Printing to an in-memory handle now works if the $scalar holds a reference,
+stringifying the reference before modifying it.  References used to be
+treated as empty strings.
+
+Printing to an in-memory handle no longer crashes if the $scalar happens to
+hold a number internally, but no string buffer.
+
+=item *
+
 L<POSIX> has been upgraded from version 1.27 to version 1.29.
 
 C<sigsuspend> and C<pause> now run signals handle before returning, as the
@@ -302,13 +323,37 @@ XXX Changes which significantly change existing files in F<pod/> go here.
 However, any changes to F<pod/perldiag.pod> should go in the L</Diagnostics>
 section.
 
-=head3 L<XXX>
+=head3 L<perlfunc>
 
 =over 4
 
 =item *
 
-XXX Description of the change here
+C<dbmopen> treats a 0 mode as a special case, that prevents a nonexistent
+file from being created.  This has been the case since Perl 5.000, but was
+never documented anywhere.  Now the perlfunc entry mentions it
+[perl #90064].
+
+=item *
+
+The entry for C<split> has been rewritten.  It is now far clearer than
+before.
+
+=back
+
+=head3 L<perlop> and L<perlsyn>
+
+=over 4
+
+=item *
+
+Documentation of the smartmatch operator has been reworked and moved from
+perlsyn to perlop where it belongs.
+
+=item *
+
+Documentation of the ellipsis statement (C<...>) has been reworked and
+moved from perlop to perlsyn.
 
 =back
 
@@ -383,6 +428,23 @@ XXX Describe change here
 
 =back
 
+=head2 Removals
+
+=over 4
+
+=item *
+
+"sort is now a reserved word"
+
+This error used to occur when C<sort> was called without arguments, followed by C<;> or C<)>.  (E.g., C<sort;> would die, but C<{sort}> was
+OK.)  This error message was added in Perl 3 to catch code like
+C<close(sort)> which would no longer work.  More than two decades later,
+this message is no longer appropriate.  Now C<sort> without arguments is
+always allowed, and returns an empty list, as it did in those cases where
+it was already allowed [perl #90030].
+
+=back
+
 =head1 Utility Changes
 
 XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go
@@ -725,6 +787,57 @@ anything, even if $_ was tied before that.  But, due to an oversight, it
 would still call FETCH once on a tied $_ before replacing it with the new
 variable.  This has been fixed [perl #105912].
 
+=item * Returning tied variables
+
+When returning a value from a non-lvalue subroutine, Perl copies the value.
+Sometimes it cheats for the sake of speed, and does not copy the value if
+it makes no observable difference.  This optimisation was erroneously
+allowing the copy to be skipped on tied variables, causing a difference in
+behaviour depending on the tied variable's reference count.  This has been
+fixed [perl #95548].
+
+=item * C<{@a = sort}> no longer crashes
+
+This particular piece of code (C<sort> with no arguments assigned to an
+array, inside a block with no C<;>) started crashing in an earlier 5.15.x
+release.  It has been fixed.
+
+=item * C<utf8::decode> and read-only scalars
+
+C<utf8::decode> now refuses to modify read-only scalars [perl #91850].
+
+=item * C<dbmopen> with undefined mode
+
+C<dbmopen> now only warns once, rather than three times, if the mode
+argument is C<undef> [perl #90064].
+
+=item * Freeing an aggregate during list assignment
+
+If list assignment to a hash or array triggered destructors that freed the
+hash or array itself, a crash would ensue.  This is no longer the case
+[perl #107440].
+
+=item * Confused internal bookkeeping with @ISA arrays
+
+Creating a weak reference to an @ISA array or accessing the array index
+(C<$#ISA>) could result in confused internal bookkeeping for elements
+subsequently added to the @ISA array.  For instance, creating a weak
+reference to the element itself could push that weak reference on to @ISA;
+and elements added after use of C<$#ISA> would be ignored by method lookup
+[perl #85670].
+
+=item * DELETE on scalar ties
+
+Tying an element of %ENV or C<%^H> and then deleting that element would
+result in a call to the tie object's DELETE method, even though tying the
+element itself is supposed to be equivalent to tying a scalar (the element
+is, of course, a scalar) [perl #67490].
+
+=item * Freeing $_ inside C<grep> or C<map>
+
+Freeing $_ inside a C<grep> or C<map> block or a code block embedded in a
+regular expression used to result in double frees [perl #92254, #92256].
+
 =back
 
 =head1 Known Problems

--
Perl5 Master Repository



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About