[perl.git] branch blead updated. v5.27.10-51-g3b98040677

2018-03-30 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/3b98040677439914b935745adaabcc2511ff14d0?hp=a77eff3cee8f0785758b235ecf8fc42a4f945e08>

- Log -
commit 3b98040677439914b935745adaabcc2511ff14d0
Author: Zefram <zef...@fysh.org>
Date:   Sat Mar 31 00:06:26 2018 +0100

fix versions in doc of signature/attribute diag

The documentation for the new diagnostic about attributes and signatures
being provided in the wrong order, for [perl #132760], mentions the
versions of perl in which the order changed.  It had the versions slightly
wrong, implying introduction of signatures in 5.18 and the change to
signatures being before attributes in 5.20.  In fact signatures were
introduced in 5.20, and the order was first changed in 5.22.

---

Summary of changes:
 pod/perldiag.pod | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index 6e0740c93a..860b049368 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -5875,10 +5875,10 @@ C may break this.
 
 (F) When subroutine signatures are enabled, any subroutine attributes must
 come before the signature. Note that this order was the opposite in
-versions 5.20..5.26. So:
+versions 5.22..5.26. So:
 
-sub foo :lvalue ($a, $b) { ... }  # 5.18 and 5.28 +
-sub foo ($a, $b) :lvalue { ... }  # 5.20 .. 5.26
+sub foo :lvalue ($a, $b) { ... }  # 5.20 and 5.28 +
+sub foo ($a, $b) :lvalue { ... }  # 5.22 .. 5.26
 
 =item Subroutine "&%s" is not available
 

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.10-50-ga77eff3cee

2018-03-30 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/a77eff3cee8f0785758b235ecf8fc42a4f945e08?hp=520aba9828daf9fa3303b933f477053b4742dc90>

- Log -
commit a77eff3cee8f0785758b235ecf8fc42a4f945e08
Author: Zefram <zef...@fysh.org>
Date:   Fri Mar 30 23:07:36 2018 +0100

delete unreliable test of Carp crash avoidance

rt52610_crash.t was introduced by commit
4764858cb80e76fdba33cc1b3be8fcdef26df754, and is predicated on
the mythical effectiveness of that commit's code change in avoiding
stack-not-refcounted crashes, an effectiveness also expressed in that
commit's very inaccurate commit message.  In fact the code change will
avoid *some* crashes, but cannot guarantee to avoid crashing in any
particular situation of the kind that it targets.  It is therefore not
possible to have a test for it avoiding a stack-not-refcounted crash,
with any expectation that the test would reliably pass or even reliably
avoid crashing.  rt52610_crash.t must therefore be deleted.

---

Summary of changes:
 MANIFEST|  1 -
 dist/Carp/lib/Carp.pm   |  2 +-
 dist/Carp/lib/Carp/Heavy.pm |  2 +-
 dist/Carp/t/rt52610_crash.t | 25 -
 4 files changed, 2 insertions(+), 28 deletions(-)
 delete mode 100644 dist/Carp/t/rt52610_crash.t

diff --git a/MANIFEST b/MANIFEST
index 235689d946..7eb34a712d 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -2988,7 +2988,6 @@ dist/Carp/t/Carp_overloadless.t   See if Carp 
handles overloads that dont use ove
 dist/Carp/t/errno.tSee if Carp preserves $! and $^E
 dist/Carp/t/heavy.tSee if Carp::Heavy works
 dist/Carp/t/heavy_mismatch.t   See if Carp::Heavy catches version 
mismatch
-dist/Carp/t/rt52610_crash.tTest that we can gracefully handle 
serializing the stack with stack-refcounting bugs
 dist/Carp/t/stack_after_err.t  Test stack traces after syntax errors
 dist/Carp/t/stash_deletion.t   See if Carp handles stash deletion
 dist/Carp/t/swash.tSee if Carp avoids breaking swash loading
diff --git a/dist/Carp/lib/Carp.pm b/dist/Carp/lib/Carp.pm
index 97f6604a17..109b7fec77 100644
--- a/dist/Carp/lib/Carp.pm
+++ b/dist/Carp/lib/Carp.pm
@@ -211,7 +211,7 @@ BEGIN {
 }
 
 
-our $VERSION = '1.49';
+our $VERSION = '1.50';
 $VERSION =~ tr/_//d;
 
 our $MaxEvalLen = 0;
diff --git a/dist/Carp/lib/Carp/Heavy.pm b/dist/Carp/lib/Carp/Heavy.pm
index e2b72920a3..a9b803c76a 100644
--- a/dist/Carp/lib/Carp/Heavy.pm
+++ b/dist/Carp/lib/Carp/Heavy.pm
@@ -2,7 +2,7 @@ package Carp::Heavy;
 
 use Carp ();
 
-our $VERSION = '1.49';
+our $VERSION = '1.50';
 $VERSION =~ tr/_//d;
 
 # Carp::Heavy was merged into Carp in version 1.12.  Any mismatched versions
diff --git a/dist/Carp/t/rt52610_crash.t b/dist/Carp/t/rt52610_crash.t
deleted file mode 100644
index faa19cb890..00
--- a/dist/Carp/t/rt52610_crash.t
+++ /dev/null
@@ -1,25 +0,0 @@
-use warnings;
-use strict;
-
-use Test::More tests => 1;
-
-use Carp ();
-
-sub do_carp {
-Carp::longmess;
-}
-
-sub call_with_args {
-my ($arg_hash, $func) = @_;
-$func->(@{$arg_hash->{'args'}});
-}
-
-my $msg;
-my $h = {};
-my $arg_hash = {'args' => [undef]};
-call_with_args($arg_hash, sub {
-$arg_hash->{'args'} = [];
-$msg = do_carp(sub { $h; });
-});
-
-like $msg, qr/^ at.+\b(?i:rt52610_crash\.t) line \d+\.\n\tmain::__ANON__\(.*\) 
called at.+\b(?i:rt52610_crash\.t) line 
\d+\n\tmain::call_with_args\(HASH\(0x[[:xdigit:]]+\), CODE\(0x[[:xdigit:]]+\)\) 
called at.+\b(?i:rt52610_crash\.t) line \d+$/;

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.8-365-gd594884e1d

2018-02-23 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/d594884e1d755afc27a0fee39c2025cc581a3dc4?hp=d3a1131a9f5192057ba3745eab6315cb4c8a9713>

- Log -
commit d594884e1d755afc27a0fee39c2025cc581a3dc4
Author: Zefram <zef...@fysh.org>
Date:   Sat Feb 24 00:40:13 2018 +

better comments about Carp overload logic

The comments originally added by commit
c99363aa273278adcad39f32026629b700f9bbc3 for [perl #132828] were unclear
and a bit over-excited.

commit d0d5e94f451e1e9fec149a7b7a2aaa3ee56f6499
Author: Zefram <zef...@fysh.org>
Date:   Sat Feb 24 00:25:15 2018 +

remove spurious _ part of Carp version number

Commit 4764858cb80e76fdba33cc1b3be8fcdef26df754 unwisely
changed Carp's version number to an underscored one.  Commit
c99363aa273278adcad39f32026629b700f9bbc3 incremented the underscored
part and copied it to Carp::Heavy.  With blead being upstream for Carp,
there is no reason for it to have an underscored version number.

---

Summary of changes:
 dist/Carp/lib/Carp.pm   | 21 ++---
 dist/Carp/lib/Carp/Heavy.pm |  2 +-
 2 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/dist/Carp/lib/Carp.pm b/dist/Carp/lib/Carp.pm
index 8f93af11ac..610e07fe1a 100644
--- a/dist/Carp/lib/Carp.pm
+++ b/dist/Carp/lib/Carp.pm
@@ -116,7 +116,7 @@ BEGIN {
;
 }
 
-our $VERSION = '1.47_02';
+our $VERSION = '1.47';
 $VERSION =~ tr/_//d;
 
 our $MaxEvalLen = 0;
@@ -336,17 +336,16 @@ sub format_arg {
 }
 else
 {
-# this particular bit of magic looking code is responsible for 
disabling overloads
-# while we are stringifing arguments, otherwise if an overload 
calls a Carp sub we
-# could end up in infinite recursion, which means we will exhaust 
the C stack and
-# then segfault. Calling Carp obviously should not trigger an 
untrappable exception
-# from Carp itself! - Yves
 if ($pack->can("((")) {
-# this eval is required, or fail the overload test
-# in dist/Carp/t/vivify_stash.t, which is really quite weird.
-# Even if we never enter this block, the presence of the 
require
-# causes the test to fail. This seems like it might be a bug
-# in require. Needs further investigation - Yves
+   # Argument is blessed into a class with overloading, and
+   # so might have an overloaded stringification.  We don't
+   # want to risk getting the overloaded stringification,
+   # so we need to use overload::StrVal() below.  But it's
+   # possible that the overload module hasn't been loaded:
+   # overload methods can be installed without it.  So load
+   # the module here.  The eval layer here avoids the
+   # compile-time effect of require vivifying the target
+   # module's stash.
 eval "require overload; 1"
 or return "use overload failed";
 }
diff --git a/dist/Carp/lib/Carp/Heavy.pm b/dist/Carp/lib/Carp/Heavy.pm
index 75ca4c5225..a82325f4ce 100644
--- a/dist/Carp/lib/Carp/Heavy.pm
+++ b/dist/Carp/lib/Carp/Heavy.pm
@@ -2,7 +2,7 @@ package Carp::Heavy;
 
 use Carp ();
 
-our $VERSION = '1.47_02';
+our $VERSION = '1.47';
 $VERSION =~ tr/_//d;
 
 # Carp::Heavy was merged into Carp in version 1.12.  Any mismatched versions

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.8-273-g08401071a3

2018-02-17 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/08401071a36d8855d06553b44b678e51d33f09e5?hp=1e888967e7732658ae6e3e523176253770138968>

- Log -
commit 08401071a36d8855d06553b44b678e51d33f09e5
Author: Zefram <zef...@fysh.org>
Date:   Sat Feb 17 18:10:48 2018 +

define NEED_croak_xs_usage in PathTools

ppport.h nowadays defines croak_xs_usage(), which is of course used
in the XS code, but its definition is broken unless the flag macro
NEED_croak_xs_usage was defined first.  Define the flag macro to avoid
breakage.

---

Summary of changes:
 dist/PathTools/Cwd.pm | 2 +-
 dist/PathTools/Cwd.xs | 1 +
 dist/PathTools/lib/File/Spec.pm   | 2 +-
 dist/PathTools/lib/File/Spec/AmigaOS.pm   | 2 +-
 dist/PathTools/lib/File/Spec/Cygwin.pm| 2 +-
 dist/PathTools/lib/File/Spec/Epoc.pm  | 2 +-
 dist/PathTools/lib/File/Spec/Functions.pm | 2 +-
 dist/PathTools/lib/File/Spec/Mac.pm   | 2 +-
 dist/PathTools/lib/File/Spec/OS2.pm   | 2 +-
 dist/PathTools/lib/File/Spec/Unix.pm  | 2 +-
 dist/PathTools/lib/File/Spec/VMS.pm   | 2 +-
 dist/PathTools/lib/File/Spec/Win32.pm | 2 +-
 12 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/dist/PathTools/Cwd.pm b/dist/PathTools/Cwd.pm
index 451c69d3d1..b045bc83a1 100644
--- a/dist/PathTools/Cwd.pm
+++ b/dist/PathTools/Cwd.pm
@@ -3,7 +3,7 @@ use strict;
 use Exporter;
 
 
-our $VERSION = '3.72';
+our $VERSION = '3.73';
 my $xs_version = $VERSION;
 $VERSION =~ tr/_//d;
 
diff --git a/dist/PathTools/Cwd.xs b/dist/PathTools/Cwd.xs
index 8de5e28285..2ca8acd6ab 100644
--- a/dist/PathTools/Cwd.xs
+++ b/dist/PathTools/Cwd.xs
@@ -7,6 +7,7 @@
 #include "EXTERN.h"
 #include "perl.h"
 #include "XSUB.h"
+#define NEED_croak_xs_usage
 #define NEED_sv_2pv_flags
 #define NEED_my_strlcpy
 #define NEED_my_strlcat
diff --git a/dist/PathTools/lib/File/Spec.pm b/dist/PathTools/lib/File/Spec.pm
index ca90b9e610..b7f47a6123 100644
--- a/dist/PathTools/lib/File/Spec.pm
+++ b/dist/PathTools/lib/File/Spec.pm
@@ -2,7 +2,7 @@ package File::Spec;
 
 use strict;
 
-our $VERSION = '3.72';
+our $VERSION = '3.73';
 $VERSION =~ tr/_//d;
 
 my %module = (
diff --git a/dist/PathTools/lib/File/Spec/AmigaOS.pm 
b/dist/PathTools/lib/File/Spec/AmigaOS.pm
index a9bdefc9fa..57e92062a1 100644
--- a/dist/PathTools/lib/File/Spec/AmigaOS.pm
+++ b/dist/PathTools/lib/File/Spec/AmigaOS.pm
@@ -3,7 +3,7 @@ package File::Spec::AmigaOS;
 use strict;
 require File::Spec::Unix;
 
-our $VERSION = '3.72';
+our $VERSION = '3.73';
 $VERSION =~ tr/_//d;
 
 our @ISA = qw(File::Spec::Unix);
diff --git a/dist/PathTools/lib/File/Spec/Cygwin.pm 
b/dist/PathTools/lib/File/Spec/Cygwin.pm
index e0b9abb4f3..5332cc120c 100644
--- a/dist/PathTools/lib/File/Spec/Cygwin.pm
+++ b/dist/PathTools/lib/File/Spec/Cygwin.pm
@@ -3,7 +3,7 @@ package File::Spec::Cygwin;
 use strict;
 require File::Spec::Unix;
 
-our $VERSION = '3.72';
+our $VERSION = '3.73';
 $VERSION =~ tr/_//d;
 
 our @ISA = qw(File::Spec::Unix);
diff --git a/dist/PathTools/lib/File/Spec/Epoc.pm 
b/dist/PathTools/lib/File/Spec/Epoc.pm
index dba67a781e..8cf1f70693 100644
--- a/dist/PathTools/lib/File/Spec/Epoc.pm
+++ b/dist/PathTools/lib/File/Spec/Epoc.pm
@@ -2,7 +2,7 @@ package File::Spec::Epoc;
 
 use strict;
 
-our $VERSION = '3.72';
+our $VERSION = '3.73';
 $VERSION =~ tr/_//d;
 
 require File::Spec::Unix;
diff --git a/dist/PathTools/lib/File/Spec/Functions.pm 
b/dist/PathTools/lib/File/Spec/Functions.pm
index ad0f1f4261..feb8b81582 100644
--- a/dist/PathTools/lib/File/Spec/Functions.pm
+++ b/dist/PathTools/lib/File/Spec/Functions.pm
@@ -3,7 +3,7 @@ package File::Spec::Functions;
 use File::Spec;
 use strict;
 
-our $VERSION = '3.72';
+our $VERSION = '3.73';
 $VERSION =~ tr/_//d;
 
 require Exporter;
diff --git a/dist/PathTools/lib/File/Spec/Mac.pm 
b/dist/PathTools/lib/File/Spec/Mac.pm
index 105c2b7708..7661d4ef10 100644
--- a/dist/PathTools/lib/File/Spec/Mac.pm
+++ b/dist/PathTools/lib/File/Spec/Mac.pm
@@ -4,7 +4,7 @@ use strict;
 use Cwd ();
 require File::Spec::Unix;
 
-our $VERSION = '3.72';
+our $VERSION = '3.73';
 $VERSION =~ tr/_//d;
 
 our @ISA = qw(File::Spec::Unix);
diff --git a/dist/PathTools/lib/File/Spec/OS2.pm 
b/dist/PathTools/lib/File/Spec/OS2.pm
index c57cfd88e3..87ba407d45 100644
--- a/dist/PathTools/lib/File/Spec/OS2.pm
+++ b/dist/PathTools/lib/File/Spec/OS2.pm
@@ -4,7 +4,7 @@ use strict;
 use Cwd ();
 require File::Spec::Unix;
 
-our $VERSION = '3.72';
+our $VERSION = '3.73';
 $VERSION =~ tr/_//d;
 
 our @ISA = qw(File::Spec::Unix);
diff --git a/dist/PathTools/lib/File/Spec/Unix.pm 
b/dist/PathTools/lib/File/Spec/Unix.pm
index ff140a62e1..7386833000 100644
--- a/dist/PathTools/lib/File/Spec/Unix.pm
+++ b/dist/PathTools/lib/File/Spec/Unix.pm
@@ -

[perl.git] branch blead updated. v5.27.8-265-gfed9fe5b48

2018-02-16 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/fed9fe5b48ccdffef9065a03c12c237cc7418de6?hp=4bd13559a0807d1dfa3c0ebf7d8807b318cdd711>

- Log -
commit fed9fe5b48ccdffef9065a03c12c237cc7418de6
Author: Zefram <zef...@fysh.org>
Date:   Fri Feb 16 17:20:34 2018 +

don't clobber file bytes in :encoding layer

The PerlIO::encoding layer, when used on input, was creating an SvLEN==0
scalar pointing into the byte buffer, to pass to the ->decode method
of the encoding object.  Since the method mutates this scalar, for some
encodings this led to mutating the byte buffer, and depending on where
it came from that might be something visible elsewhere that should not
be mutated.  Remove the code for the SvLEN==0 scalar, instead always
using the alternate code that would copy the bytes into a separate buffer
owned by the scalar.  Fixes [perl #132833].

---

Summary of changes:
 ext/PerlIO-encoding/encoding.pm  |  2 +-
 ext/PerlIO-encoding/encoding.xs  | 43 ++--
 ext/PerlIO-encoding/t/encoding.t | 12 ++-
 3 files changed, 22 insertions(+), 35 deletions(-)

diff --git a/ext/PerlIO-encoding/encoding.pm b/ext/PerlIO-encoding/encoding.pm
index 08d2df4713..3d740b181a 100644
--- a/ext/PerlIO-encoding/encoding.pm
+++ b/ext/PerlIO-encoding/encoding.pm
@@ -1,7 +1,7 @@
 package PerlIO::encoding;
 
 use strict;
-our $VERSION = '0.25';
+our $VERSION = '0.26';
 our $DEBUG = 0;
 $DEBUG and warn __PACKAGE__, " called by ", join(", ", caller), "\n";
 
diff --git a/ext/PerlIO-encoding/encoding.xs b/ext/PerlIO-encoding/encoding.xs
index bb4754f3d9..941d786266 100644
--- a/ext/PerlIO-encoding/encoding.xs
+++ b/ext/PerlIO-encoding/encoding.xs
@@ -307,42 +307,19 @@ PerlIOEncode_fill(pTHX_ PerlIO * f)
goto end_of_file;
}
}
-   if (SvCUR(e->dataSV)) {
-   /* something left over from last time - create a normal
-  SV with new data appended
-*/
-   if (use + SvCUR(e->dataSV) > e->base.bufsiz) {
-   if (e->flags & NEEDS_LINES) {
-   /* Have to grow buffer */
-   e->base.bufsiz = use + SvCUR(e->dataSV);
-   PerlIOEncode_get_base(aTHX_ f);
-   }
-   else {
-  use = e->base.bufsiz - SvCUR(e->dataSV);
-   }
-   }
-   sv_catpvn(e->dataSV,(char*)ptr,use);
-   }
-   else {
-   /* Create a "dummy" SV to represent the available data from layer 
below */
-   if (SvLEN(e->dataSV) && SvPVX_const(e->dataSV)) {
-   Safefree(SvPVX_mutable(e->dataSV));
-   }
-   if (use > (SSize_t)e->base.bufsiz) {
-   if (e->flags & NEEDS_LINES) {
-   /* Have to grow buffer */
-   e->base.bufsiz = use;
-   PerlIOEncode_get_base(aTHX_ f);
-   }
-   else {
-  use = e->base.bufsiz;
+   if (!SvCUR(e->dataSV))
+   SvPVCLEAR(e->dataSV);
+   if (use + SvCUR(e->dataSV) > e->base.bufsiz) {
+   if (e->flags & NEEDS_LINES) {
+   /* Have to grow buffer */
+   e->base.bufsiz = use + SvCUR(e->dataSV);
+   PerlIOEncode_get_base(aTHX_ f);
}
+   else {
+   use = e->base.bufsiz - SvCUR(e->dataSV);
}
-   SvPV_set(e->dataSV, (char *) ptr);
-   SvLEN_set(e->dataSV, 0);  /* Hands off sv.c - it isn't yours */
-   SvCUR_set(e->dataSV,use);
-   SvPOK_only(e->dataSV);
}
+   sv_catpvn(e->dataSV,(char*)ptr,use);
SvUTF8_off(e->dataSV);
PUSHMARK(sp);
XPUSHs(e->enc);
diff --git a/ext/PerlIO-encoding/t/encoding.t b/ext/PerlIO-encoding/t/encoding.t
index 088f89ee20..41cefcb137 100644
--- a/ext/PerlIO-encoding/t/encoding.t
+++ b/ext/PerlIO-encoding/t/encoding.t
@@ -16,7 +16,7 @@ BEGIN {
 require "../../t/charset_tools.pl";
 }
 
-use Test::More tests => 24;
+use Test::More tests => 27;
 
 my $grk = "grk$$";
 my $utf = "utf$$";
@@ -231,6 +231,16 @@ is $x, "To hymn him who heard her herd herd\n",
 
 } # SKIP
 
+# decoding shouldn't mutate the original bytes [perl #132833]
+{
+my $b = "a\0b\0\n\0";
+open my $fh, "<:encoding(UTF16-LE)", \$b or die;
+is scalar(<$fh>), "ab\n";
+is $b, "a\0b\0\n\0";
+close $fh or die;
+is $b, "a\0b\0\n\0";
+}
+
 END {
 1 while unlink($grk, $utf, $fail1, $fail2, $russki, $threebyte);
 }

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.8-262-g682f3ac7d3

2018-02-15 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/682f3ac7d3c98fe1aa251a2e30684eeb7b859a0e?hp=599926360f3b0336743acf167763375ab7f79d41>

- Log -
commit 682f3ac7d3c98fe1aa251a2e30684eeb7b859a0e
Author: Zefram <zef...@fysh.org>
Date:   Thu Feb 15 18:21:14 2018 +

avoid vivifying UNIVERSAL::isa:: in Carp

The test added to Carp by commit 915a6810d3e3198d759f025f85d1fd6f3171dd27
for UNIVERSAL::isa being loaded had the side effect of vivifying the
UNIVERSAL::isa stash.  Take more care about checking for UNIVERSAL::isa
to avoid vivifying it, as for the other checks for things in optional
modules.  Fixes [perl #132788].

---

Summary of changes:
 dist/Carp/lib/Carp.pm   | 18 --
 dist/Carp/lib/Carp/Heavy.pm |  2 +-
 dist/Carp/t/vivify_stash.t  |  8 +---
 3 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/dist/Carp/lib/Carp.pm b/dist/Carp/lib/Carp.pm
index 65d22b1b2b..eb7ad7bb06 100644
--- a/dist/Carp/lib/Carp.pm
+++ b/dist/Carp/lib/Carp.pm
@@ -116,7 +116,7 @@ BEGIN {
;
 }
 
-our $VERSION = '1.45';
+our $VERSION = '1.46';
 $VERSION =~ tr/_//d;
 
 our $MaxEvalLen = 0;
@@ -277,6 +277,20 @@ sub caller_info {
 return wantarray() ? %call_info : \%call_info;
 }
 
+sub _univisa_loaded {
+return 0 unless exists($::{"UNIVERSAL::"});
+for ($::{"UNIVERSAL::"}) {
+   return 0 unless ref \$_ eq "GLOB" && *$_{HASH} && exists $$_{"isa::"};
+   for ($$_{"isa::"}) {
+   return 0 unless ref \$_ eq "GLOB" && *$_{HASH} && exists 
$$_{"VERSION"};
+   for ($$_{"VERSION"}) {
+   return 0 unless ref \$_ eq "GLOB";
+   return ${*$_{SCALAR}};
+   }
+   }
+}
+}
+
 # Transform an argument to a function into a string.
 our $in_recurse;
 sub format_arg {
@@ -286,7 +300,7 @@ sub format_arg {
 
 # lazy check if the CPAN module UNIVERSAL::isa is used or not
 #   if we use a rogue version of UNIVERSAL this would lead to infinite 
loop
-my $isa = $UNIVERSAL::isa::VERSION ? sub { 1 } : \::isa;
+my $isa = _univisa_loaded() ? sub { 1 } : _fetch_sub(UNIVERSAL => 
"isa");
 
  # legitimate, let's not leak it.
 if (!$in_recurse && $isa->( $arg, 'UNIVERSAL' ) &&
diff --git a/dist/Carp/lib/Carp/Heavy.pm b/dist/Carp/lib/Carp/Heavy.pm
index 6575c63d84..1d4bab613f 100644
--- a/dist/Carp/lib/Carp/Heavy.pm
+++ b/dist/Carp/lib/Carp/Heavy.pm
@@ -2,7 +2,7 @@ package Carp::Heavy;
 
 use Carp ();
 
-our $VERSION = '1.45';
+our $VERSION = '1.46';
 $VERSION =~ tr/_//d;
 
 # Carp::Heavy was merged into Carp in version 1.12.  Any mismatched versions
diff --git a/dist/Carp/t/vivify_stash.t b/dist/Carp/t/vivify_stash.t
index 0ac66d89e0..455aded7c1 100644
--- a/dist/Carp/t/vivify_stash.t
+++ b/dist/Carp/t/vivify_stash.t
@@ -1,8 +1,9 @@
-BEGIN { print "1..5\n"; }
+BEGIN { print "1..6\n"; }
 
 our $has_utf8; BEGIN { $has_utf8 = exists($::{"utf8::"}); }
 our $has_overload; BEGIN { $has_overload = exists($::{"overload::"}); }
 our $has_B; BEGIN { $has_B = exists($::{"B::"}); }
+our $has_UNIVERSAL_isa; BEGIN { $has_UNIVERSAL_isa = 
exists($UNIVERSAL::{"isa::"}); }
 
 use Carp;
 sub { sub { Carp::longmess("x") }->() }->(\1, "\x{2603}", qr/\x{2603}/);
@@ -10,16 +11,17 @@ sub { sub { Carp::longmess("x") }->() }->(\1, "\x{2603}", 
qr/\x{2603}/);
 print !(exists($::{"utf8::"}) xor $has_utf8) ? "" : "not ", "ok 1\n";
 print !(exists($::{"overload::"}) xor $has_overload) ? "" : "not ", "ok 2\n";
 print !(exists($::{"B::"}) xor $has_B) ? "" : "not ", "ok 3\n";
+print !(exists($UNIVERSAL::{"isa::"}) xor $has_UNIVERSAL_isa) ? "" : "not ", 
"ok 4\n";
 
 # Autovivify $::{"overload::"}
 () = \$::{"overload::"};
 () = \$::{"utf8::"};
 eval { sub { Carp::longmess() }->(\1) };
-print $@ eq '' ? "ok 4\n" : "not ok 4\n# $@";
+print $@ eq '' ? "ok 5\n" : "not ok 5\n# $@";
 
 # overload:: glob without hash
 undef *{"overload::"};
 eval { sub { Carp::longmess() }->(\1) };
-print $@ eq '' ? "ok 5\n" : "not ok 5\n# $@";
+print $@ eq '' ? "ok 6\n" : "not ok 6\n# $@";
 
 1;

-- 
Perl5 Master Repository


[perl.git] branch zefram/deprecate_some_fake_import_fatal created. v5.27.8-31-g9327487d13

2018-01-28 Thread Zefram
In perl.git, the branch zefram/deprecate_some_fake_import_fatal has been created

<https://perl5.git.perl.org/perl.git/commitdiff/9327487d13ec0ffc319a1a130d8a9babad4bee83?hp=>

at  9327487d13ec0ffc319a1a130d8a9babad4bee83 (commit)

- Log -
commit 9327487d13ec0ffc319a1a130d8a9babad4bee83
Author: Zefram <zef...@fysh.org>
Date:   Sun Jan 28 15:28:26 2018 +

make fake import/unimport deprecation fatal

This is intended for smoking CPAN, to determine what impact the
deprecation would have.  This fatalisation should not be applied to
blead in this form.

---

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-182-gf5e05609e9

2018-01-18 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/f5e05609e91b87dfd326d3461fc9740f0d4deedf?hp=60fa46621ae5d0d44c802aedc205274584701fa0>

- Log -
commit f5e05609e91b87dfd326d3461fc9740f0d4deedf
Author: Zefram <zef...@fysh.org>
Date:   Fri Jan 19 06:38:07 2018 +

perldelta 60fa46621ae5d0d44c802aedc205274584701fa0

---

Summary of changes:
 pod/perldelta.pod | 5 +
 1 file changed, 5 insertions(+)

diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 97b364eb9c..163e21c10d 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -293,6 +293,11 @@ Several fix-ups for F, marking function VMS 
has
 
 =item *
 
+The C format specifier C<%.0f> no longer rounds incorrectly
+[perl #47602], and now shows the correct sign for a negative zero.
+
+=item *
+
 Fixed a use after free bug in pp_list introduced in 5.27.1.  [perl #131954]
 
 =item *

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-181-g60fa46621a

2018-01-18 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/60fa46621ae5d0d44c802aedc205274584701fa0?hp=8c7aa727bdcea40fd6b4ffb9ca8bbf53c0fadb10>

- Log -
commit 60fa46621ae5d0d44c802aedc205274584701fa0
Author: Zefram <zef...@fysh.org>
Date:   Fri Jan 19 05:05:07 2018 +

fix F0convert() on edge cases

The F0convert() function used to implement the %.0f format specifier
more cheaply went wrong on some edge cases.  Its rounding went wrong
when the exponent is such that fractional values are not representable,
making the "+= 0.5" invoke floating point rounding.  Fix that by only
invoking that rounding logic for values that start out fractional.
That fixes the output part of [perl #47602].  It also failed to emit the
sign for negative zero.  Fix that by making it not apply to zero values.

---

Summary of changes:
 sv.c| 11 +++
 t/op/sprintf2.t |  7 +++
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/sv.c b/sv.c
index 2c13b3b333..6ad33c0bfc 100644
--- a/sv.c
+++ b/sv.c
@@ -11057,12 +11057,15 @@ S_F0convert(NV nv, char *const endbuf, STRLEN *const 
len)
 assert(!Perl_isinfnan(nv));
 if (neg)
nv = -nv;
-if (nv < UV_MAX) {
+if (nv != 0.0 && nv < UV_MAX) {
char *p = endbuf;
-   nv += 0.5;
uv = (UV)nv;
-   if (uv & 1 && uv == nv)
-   uv--;   /* Round to even */
+   if (uv != nv) {
+   nv += 0.5;
+   uv = (UV)nv;
+   if (uv & 1 && uv == nv)
+   uv--;   /* Round to even */
+   }
do {
const unsigned dig = uv % 10;
*--p = '0' + dig;
diff --git a/t/op/sprintf2.t b/t/op/sprintf2.t
index bf092032bb..5fb75974cb 100644
--- a/t/op/sprintf2.t
+++ b/t/op/sprintf2.t
@@ -1123,5 +1123,12 @@ like sprintf("%p", 0+'NaN'), qr/^[0-9a-f]+$/, "%p and 
NaN";
 "\\x80 in format";
 }
 
+foreach(
+0.0, -0.0,
+4503599627370501, -4503599627370501,
+4503599627370503, -4503599627370503,
+) {
+is sprintf("%.0f", $_), sprintf("%-.0f", $_), "special-case %.0f on $_";
+}
 
 done_testing();

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-176-g7426929780

2018-01-18 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/7426929780f7cd09d7e32c48d8c6151841479112?hp=71cec5e017dc8cf17678b32f6e1910fedcd61d14>

- Log -
commit 7426929780f7cd09d7e32c48d8c6151841479112
Author: Zefram <zef...@fysh.org>
Date:   Thu Jan 18 21:31:42 2018 +

override autodetection of mkostemp() on Darwin

On Darwin 15.6.0, mkostemp() was observed to be autodetected as present
but actually be unlinkable.  It is unknown what other Darwin versions
are affected, so for the time being just override the autodetection on
all versions.

commit 884fc2d39dfcec3db11eecde0cdd7c30846e153b
Author: Zefram <zef...@fysh.org>
Date:   Thu Jan 18 21:23:55 2018 +

Revert "Revert "make PerlIO handle FD_CLOEXEC""

This reverts commit 523d71b314dc75bd212794cc8392eab8267ea744, reinstating
commit 2cdf406af42834c46ef407517daab0734f7066fc.  Reversion is not the
way to address the porting problem that motivated that reversion.

---

Summary of changes:
 doio.c  | 50 ++-
 embed.fnc   |  4 +++-
 embed.h |  2 ++
 hints/darwin.sh |  4 
 perl.c  |  4 +---
 perlio.c| 60 -
 pod/perliol.pod | 11 +++
 pp_sys.c|  6 --
 proto.h |  6 +++---
 toke.c  |  5 -
 util.c  |  8 
 11 files changed, 89 insertions(+), 71 deletions(-)

diff --git a/doio.c b/doio.c
index d18e335a04..4b8923f77c 100644
--- a/doio.c
+++ b/doio.c
@@ -78,6 +78,14 @@ Perl_setfd_inhexec(int fd)
 #endif
 }
 
+void
+Perl_setfd_cloexec_for_nonsysfd(pTHX_ int fd)
+{
+assert(fd >= 0);
+if(fd > PL_maxsysfd)
+   setfd_cloexec(fd);
+}
+
 void
 Perl_setfd_inhexec_for_sysfd(pTHX_ int fd)
 {
@@ -85,6 +93,16 @@ Perl_setfd_inhexec_for_sysfd(pTHX_ int fd)
 if(fd <= PL_maxsysfd)
setfd_inhexec(fd);
 }
+void
+Perl_setfd_cloexec_or_inhexec_by_sysfdness(pTHX_ int fd)
+{
+assert(fd >= 0);
+if(fd <= PL_maxsysfd)
+   setfd_inhexec(fd);
+else
+   setfd_cloexec(fd);
+}
+
 
 #define DO_GENOPEN_THEN_CLOEXEC(GENOPEN_NORMAL, GENSETFD_CLOEXEC) \
do { \
@@ -700,7 +718,7 @@ Perl_do_open6(pTHX_ GV *gv, const char *oname, STRLEN len,
}
else {
if (dodup)
-wanted_fd = PerlLIO_dup(wanted_fd);
+wanted_fd = PerlLIO_dup_cloexec(wanted_fd);
else
was_fdopen = TRUE;
 if (!(fp = PerlIO_openn(aTHX_ 
type,mode,wanted_fd,0,0,NULL,num_svs,svp))) {
@@ -991,33 +1009,15 @@ S_openn_cleanup(pTHX_ GV *gv, IO *io, PerlIO *fp, char 
*mode, const char *oname,
if (was_fdopen) {
 /* need to close fp without closing underlying fd */
 int ofd = PerlIO_fileno(fp);
-int dupfd = ofd >= 0 ? PerlLIO_dup(ofd) : -1;
-#if defined(HAS_FCNTL) && defined(F_SETFD)
-   /* Assume if we have F_SETFD we have F_GETFD. */
-/* Get a copy of all the fd flags. */
-int fd_flags = ofd >= 0 ? fcntl(ofd, F_GETFD) : -1;
-if (fd_flags < 0) {
-if (dupfd >= 0)
-PerlLIO_close(dupfd);
-goto say_false;
-}
-#endif
+int dupfd = ofd >= 0 ? PerlLIO_dup_cloexec(ofd) : -1;
 if (ofd < 0 || dupfd < 0) {
 if (dupfd >= 0)
 PerlLIO_close(dupfd);
 goto say_false;
 }
 PerlIO_close(fp);
-PerlLIO_dup2(dupfd, ofd);
-#if defined(HAS_FCNTL) && defined(F_SETFD)
-   /* The dup trick has lost close-on-exec on ofd,
- * and possibly any other flags, so restore them. */
-   if (fcntl(ofd,F_SETFD, fd_flags) < 0) {
-if (dupfd >= 0)
-PerlLIO_close(dupfd);
-goto say_false;
-}
-#endif
+PerlLIO_dup2_cloexec(dupfd, ofd);
+setfd_inhexec_for_sysfd(ofd);
 PerlLIO_close(dupfd);
}
 else
@@ -1027,10 +1027,6 @@ S_openn_cleanup(pTHX_ GV *gv, IO *io, PerlIO *fp, char 
*mode, const char *oname,
PerlIO_clearerr(fp);
fd = PerlIO_fileno(fp);
 }
-if (fd >= 0) {
-   setfd_cloexec(fd);
-   setfd_inhexec_for_sysfd(fd);
-}
 IoIFP(io) = fp;
 
 IoFLAGS(io) &= ~IOf_NOLINE;
@@ -1100,7 +1096,7 @@ S_openindirtemp(pTHX_ GV *gv, SV *orig_name, SV 
*temp_out_name) {
 
 {
   int old_u

[perl.git] branch blead updated. v5.27.7-167-g6fc8325ded

2018-01-17 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/6fc8325ded66d545bdfa5afbeb29926b9e0680d5?hp=8e14f284e9d93dc3a96622cee4ebdc135e677581>

- Log -
commit 6fc8325ded66d545bdfa5afbeb29926b9e0680d5
Author: Zefram <zef...@fysh.org>
Date:   Thu Jan 18 03:05:10 2018 +

fix perlipc example regarding process group

Fixes [perl #54412].

---

Summary of changes:
 pod/perlipc.pod | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pod/perlipc.pod b/pod/perlipc.pod
index e3b74a55b9..902655dee6 100644
--- a/pod/perlipc.pod
+++ b/pod/perlipc.pod
@@ -67,8 +67,8 @@ so it doesn't kill itself:
 # block scope for local
 {
 local $SIG{HUP} = "IGNORE";
-kill HUP => -$$;
-# snazzy writing of: kill("HUP", -$$)
+kill HUP => -getpgrp();
+# snazzy writing of: kill("HUP", -getpgrp())
 }
 
 Another interesting signal to send is signal number zero.  This doesn't

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-165-g5109e49ff5

2018-01-17 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/5109e49ff544d495902386fbfc547a0fc9e35200?hp=a3e261d5575235597b5dd98e4cd06553bc064cf8>

- Log -
commit 5109e49ff544d495902386fbfc547a0fc9e35200
Author: Zefram <zef...@fysh.org>
Date:   Wed Jan 17 23:07:06 2018 +

expand documentation of $DB::sub

---

Summary of changes:
 pod/perldebguts.pod | 23 ---
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/pod/perldebguts.pod b/pod/perldebguts.pod
index 8587100304..3a66f24a20 100644
--- a/pod/perldebguts.pod
+++ b/pod/perldebguts.pod
@@ -94,9 +94,13 @@ unless C<< $^D & (1<<30) >> is true.
 =item *
 
 When execution of the program reaches a subroutine call, a call to
-C<::sub>(I) is made instead, with C<$DB::sub> holding the
-name of the called subroutine. (This doesn't happen if the calling
-subroutine was compiled in the C package.)
+C<::sub>(I) is made instead, with C<$DB::sub> set to identify
+the called subroutine.  (This doesn't happen if the calling subroutine
+was compiled in the C package.)  C<$DB::sub> normally holds the name
+of the called subroutine, if it has a name by which it can be looked up.
+Failing that, C<$DB::sub> will hold a reference to the called subroutine.
+Either way, the C<::sub> subroutine can use C<$DB::sub> as a reference
+by which to call the called subroutine, which it will normally want to do.
 
 X<::lsub>If the call is to an lvalue subroutine, and C<::lsub>
 is defined C<::lsub>(I) is called instead, otherwise falling
@@ -104,10 +108,15 @@ back to C<::sub>(I).
 
 =item *
 
-When execution of the program uses C to enter a non-XS
-subroutine and the 0x80 bit is set in C<$^P>, a call to C<::goto>
-is made, with C<$DB::sub> holding the name of the subroutine being
-entered.
+When execution of the program uses C to enter a non-XS subroutine
+and the 0x80 bit is set in C<$^P>, a call to C<::goto> is made, with
+C<$DB::sub> set to identify the subroutine being entered.  The call to
+C<::goto> does not replace the C; the requested subroutine will
+still be entered once C<::goto> has returned.  C<$DB::sub> normally
+holds the name of the subroutine being entered, if it has one.  Failing
+that, C<$DB::sub> will hold a reference to the subroutine being entered.
+Unlike when C<::sub> is called, it is not guaranteed that C<$DB::sub>
+can be used as a reference to operate on the subroutine being entered.
 
 =back
 

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-164-ga3e261d557

2018-01-17 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/a3e261d5575235597b5dd98e4cd06553bc064cf8?hp=06776278564fe87bbfe63e109bd3d04f7b6038f0>

- Log -
commit a3e261d5575235597b5dd98e4cd06553bc064cf8
Author: Zefram <zef...@fysh.org>
Date:   Wed Jan 17 21:44:15 2018 +

document that argv strings must be writable for $0

Resolves [perl #44129].

---

Summary of changes:
 perl.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/perl.c b/perl.c
index a27798e063..5c839f3900 100644
--- a/perl.c
+++ b/perl.c
@@ -1613,6 +1613,9 @@ interpreter, as would normally be passed to the C 
function of
 a C program.  C<argv[argc]> must be null.  These arguments are where
 the script to parse is specified, either by naming a script file or by
 providing a script in a C<-e> option.
+If L<C<$0>|perlvar/$0> will be written to in the Perl interpreter, then
+the argument strings must be in writable memory, and so mustn't just be
+string constants.
 
 C specifies a set of environment variables that will be used by
 this Perl interpreter.  If non-null, it must point to a null-terminated

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-163-g0677627856

2018-01-17 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/06776278564fe87bbfe63e109bd3d04f7b6038f0?hp=bdd1531dd1b6b698eaa4f6ba684bfd398f5800ef>

- Log -
commit 06776278564fe87bbfe63e109bd3d04f7b6038f0
Author: Zefram <zef...@fysh.org>
Date:   Wed Jan 17 21:05:25 2018 +

remove unused constant from test

commit 9e783da923ca3f2862497dc707d247839736d96a
Author: Zefram <zef...@fysh.org>
Date:   Wed Jan 17 21:03:00 2018 +

skip cwd_enoent test on Cygwin

Some of the getcwd() functions don't produce error responses when they
should on Cygwin, which is [perl #132733], and that causes cwd_enoent.t
to fail.  Pending actual fix of that bug, just skip this test on Cygwin.
This should allow [perl #132648] to be resolved.

---

Summary of changes:
 dist/PathTools/t/cwd_enoent.t | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dist/PathTools/t/cwd_enoent.t b/dist/PathTools/t/cwd_enoent.t
index 59e3612568..ee99423cbb 100644
--- a/dist/PathTools/t/cwd_enoent.t
+++ b/dist/PathTools/t/cwd_enoent.t
@@ -6,13 +6,17 @@ use Errno qw(ENOENT);
 use File::Temp qw(tempdir);
 use Test::More;
 
+if($^O eq "cygwin") {
+# This test skipping should be removed when the Cygwin bug is fixed.
+plan skip_all => "getcwd() fails to fail on Cygwin [perl #132733]";
+}
+
 my $tmp = tempdir(CLEANUP => 1);
 unless(mkdir("$tmp/testdir") && chdir("$tmp/testdir") && 
rmdir("$tmp/testdir")){
 plan skip_all => "can't be in non-existent directory";
 }
 
 plan tests => 8;
-my $EXTRA_ABSPATH_TESTS = ($Config{prefix} =~ m/\//) && $^O ne 'cygwin';
 require Cwd;
 
 foreach my $type (qw(regular perl)) {

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-155-gd77401488a

2018-01-16 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/d77401488a85b2a1918a46d5ac1bcc94e6ae1a20?hp=c7a9a2576639091bf1e3c8d8e712b5480d67d442>

- Log -
commit d77401488a85b2a1918a46d5ac1bcc94e6ae1a20
Author: Zefram <zef...@fysh.org>
Date:   Tue Jan 16 18:45:40 2018 +

additional test for lazy array element creation

---

Summary of changes:
 t/op/array.t | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/t/op/array.t b/t/op/array.t
index 4d16272459..3d9b9d7900 100644
--- a/t/op/array.t
+++ b/t/op/array.t
@@ -6,7 +6,7 @@ BEGIN {
 set_up_inc('.', '../lib');
 }
 
-plan (178);
+plan (179);
 
 #
 # @foo, @bar, and @ary are also used from tie-stdarray after tie-ing them
@@ -589,6 +589,10 @@ $#a = -1; $#a++;
 my @qr = \(@q);
 is $qr[$_], \$q[$_], "lazy element creation with refgen" foreach 0..2;
 isnt $qr[1], \undef, "lazy element creation with refgen";
+my @r;
+$r[1] = 1;
+foreach my $re ((), @r) { $re = 5; }
+is join("", @r), "55", "lazy element creation with foreach";
 }
 
 "We're included by lib/Tie/Array/std.t so we need to return something true";

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-154-gc7a9a25766

2018-01-16 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/c7a9a2576639091bf1e3c8d8e712b5480d67d442?hp=db792da6c0161e671ca54420a1a6e98bf73ca161>

- Log -
commit c7a9a2576639091bf1e3c8d8e712b5480d67d442
Author: Zefram <zef...@fysh.org>
Date:   Tue Jan 16 18:08:57 2018 +

test for IO handle in localised glob

Tests the case in [perl #16113] that failed prior to Perl 5.19.10.

---

Summary of changes:
 t/io/open.t | 18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/t/io/open.t b/t/io/open.t
index 092c5c99b1..81ca075deb 100644
--- a/t/io/open.t
+++ b/t/io/open.t
@@ -10,7 +10,7 @@ $|  = 1;
 use warnings;
 use Config;
 
-plan tests => 187;
+plan tests => 188;
 
 sub ok_cloexec {
 SKIP: {
@@ -544,3 +544,19 @@ SKIP: {
 is $t, "xyz", "buffered write happens on dropping handle ref (complex 
open)";
 is scalar(grep { /\A_GEN_/ } keys %::), 0, "no gensym appeared in stash";
 }
+
+# [perl #16113] returning handle in localised glob
+{
+my $tfile = tempfile();
+open(my $twrite, ">", $tfile) or die $!;
+print {$twrite} "foo\nbar\n" or die $!;
+close $twrite or die $!;
+$twrite = undef;
+my $tread = do {
+   local *F;
+   open(F, "<", $tfile) or die $!;
+   *F;
+};
+is scalar(<$tread>), "foo\n", "IO handle returned in localised glob";
+close $tread;
+}

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-150-g097ff42c3b

2018-01-16 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/097ff42c3bba30230d3512b3de153c75cd2e43c9?hp=6661956a23de82b41adc406200054293d6d7aded>

- Log -
commit 097ff42c3bba30230d3512b3de153c75cd2e43c9
Author: Zefram <zef...@fysh.org>
Date:   Tue Jan 16 08:04:08 2018 +

fix parsing of braced subscript after parens

Where an arrow is omitted between subscripts, if a parenthesised
subscript is followed by a braced one, PL_expect was getting set to
XBLOCK due to code intended for "foreach (...) {...}".  This broke
bareword autoquotation, and the parsing of operators following the
braced subscript.  Alter PL_expect from XBLOCK to XOPERATOR following
a parenthesised subscript.  Fixes [perl #8045].

---

Summary of changes:
 perly.act   | 248 +++-
 perly.h |   2 +-
 perly.tab   |  30 +++
 perly.y |  20 -
 t/op/postfixderef.t |  25 +-
 5 files changed, 186 insertions(+), 139 deletions(-)

diff --git a/perly.act b/perly.act
index 610963f005..082e4e7dc9 100644
--- a/perly.act
+++ b/perly.act
@@ -1209,65 +1209,77 @@ case 2:
   case 142:
 #line 942 "perly.y" /* yacc.c:1646  */
 { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
-  newCVREF(0, scalar((ps[-3].val.opval; }
+  newCVREF(0, scalar((ps[-3].val.opval;
+ if (parser->expect == XBLOCK)
+ parser->expect = XOPERATOR;
+   }
 
 break;
 
   case 143:
-#line 945 "perly.y" /* yacc.c:1646  */
+#line 948 "perly.y" /* yacc.c:1646  */
 { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
   op_append_elem(OP_LIST, (ps[-1].val.opval),
-  newCVREF(0, 
scalar((ps[-4].val.opval); }
+  newCVREF(0, 
scalar((ps[-4].val.opval);
+ if (parser->expect == XBLOCK)
+ parser->expect = XOPERATOR;
+   }
 
 break;
 
   case 144:
-#line 950 "perly.y" /* yacc.c:1646  */
+#line 956 "perly.y" /* yacc.c:1646  */
 { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
   op_append_elem(OP_LIST, (ps[-1].val.opval),
-  newCVREF(0, 
scalar((ps[-3].val.opval); }
+  newCVREF(0, 
scalar((ps[-3].val.opval);
+ if (parser->expect == XBLOCK)
+ parser->expect = XOPERATOR;
+   }
 
 break;
 
   case 145:
-#line 954 "perly.y" /* yacc.c:1646  */
+#line 963 "perly.y" /* yacc.c:1646  */
 { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
-  newCVREF(0, scalar((ps[-2].val.opval; }
+  newCVREF(0, scalar((ps[-2].val.opval;
+ if (parser->expect == XBLOCK)
+ parser->expect = XOPERATOR;
+   }
 
 break;
 
   case 146:
-#line 957 "perly.y" /* yacc.c:1646  */
+#line 969 "perly.y" /* yacc.c:1646  */
 { (yyval.opval) = newSLICEOP(0, (ps[-1].val.opval), (ps[-4].val.opval)); }
 
 break;
 
   case 147:
-#line 959 "perly.y" /* yacc.c:1646  */
+#line 971 "perly.y" /* yacc.c:1646  */
 { (yyval.opval) = newSLICEOP(0, (ps[-1].val.opval), (ps[-3].val.opval)); }
 
 break;
 
   case 148:
-#line 961 "perly.y" /* yacc.c:1646  */
+#line 973 "perly.y" /* yacc.c:1646  */
 { (yyval.opval) = newSLICEOP(0, (ps[-1].val.opval), NULL); }
 
 break;
 
   case 149:
-#line 966 "perly.y" /* yacc.c:1646  */
+#line 978 "perly.y" /* yacc.c:1646  */
 { (yyval.opval) = newASSIGNOP(OPf_STACKED, (ps[-2].val.opval), 
(ps[-1].val.ival), (ps[0].val.opval)); }
 
 break;
 
   case 150:
-#line 968 "perly.y" /* yacc.c:1646  */
+#line 980 "perly.y" /* yacc.c:1646  */
 { (yyval.opval) = newBINOP((ps[-1].val.ival), 0, 
scalar((ps[-2].val.opval)), scalar((ps[0].val.opval))); }
 
 break;
 
   case 151:
-#line 970 "perly.y" /* yacc.c:1646  */
+#line 982 "perly.y" /* yacc.c:1646  */
 {   if ((ps[-1].val.ival) != OP_REPEAT)
scalar((ps[-2].val.opval));
(yyval.opval) = newBINOP((ps[-1].val.ival), 0, 
(ps[-2].val.opval), scalar((ps[0].val.opval)));
@@ -1276,111 +1288,111 @@ case 2:
 break;
 
   case 152:
-#line 975 "perly.y" /* ya

[perl.git] branch blead updated. v5.27.7-149-g6661956a23

2018-01-15 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/6661956a23de82b41adc406200054293d6d7aded?hp=a97021b9d2cff6f0f8cbe5a5dd51187c5bad275e>

- Log -
commit 6661956a23de82b41adc406200054293d6d7aded
Author: Zefram <zef...@fysh.org>
Date:   Tue Jan 16 06:22:17 2018 +

vivify array elements when putting them on stack

When the elements of an array are put on the stack, by a padav, rv2av,
or padrange op, null pointers in the AvARRAY were being pushed as
_sv_undef, which was OK in rvalue contexts but caused misbehaviour
in lvalue contexts.  Change this to vivify these elements.  There's no
attempt here to limit the vivification to lvalue contexts: the existing
op flags aren't enough to detect \(@a), and attempting to catch all
cases where a new flag needs to be set would be an error-prone process.
Fixes [perl #8910].

---

Summary of changes:
 pp_hot.c |  8 +---
 t/op/array.t | 18 +-
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/pp_hot.c b/pp_hot.c
index 8a74f58cb8..d479ecf218 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1163,15 +1163,17 @@ S_pushav(pTHX_ AV* const av)
 if (UNLIKELY(SvRMAGICAL(av))) {
 PADOFFSET i;
 for (i=0; i < (PADOFFSET)maxarg; i++) {
-SV ** const svp = av_fetch(av, i, FALSE);
+SV ** const svp = av_fetch(av, i, TRUE);
 SP[i+1] = svp ? *svp : _sv_undef;
 }
 }
 else {
 PADOFFSET i;
 for (i=0; i < (PADOFFSET)maxarg; i++) {
-SV * const sv = AvARRAY(av)[i];
-SP[i+1] = LIKELY(sv) ? sv : _sv_undef;
+SV *sv = AvARRAY(av)[i];
+   if (!LIKELY(sv))
+   AvARRAY(av)[i] = sv = newSV(0);
+   SP[i+1] = sv;
 }
 }
 SP += maxarg;
diff --git a/t/op/array.t b/t/op/array.t
index 59ba434264..4d16272459 100644
--- a/t/op/array.t
+++ b/t/op/array.t
@@ -6,7 +6,7 @@ BEGIN {
 set_up_inc('.', '../lib');
 }
 
-plan (173);
+plan (178);
 
 #
 # @foo, @bar, and @ary are also used from tie-stdarray after tie-ing them
@@ -575,4 +575,20 @@ $#a = -1; $#a++;
 $#a = -1; $#a++;
 () = 0+splice @a, 0, 1, 1, 1;
 
+# [perl #8910] lazy creation of array elements used to leak out
+{
+sub t8910 { $_[1] = 5; $_[2] = 7; }
+my @p;
+$p[0] = 1;
+$p[2] = 2;
+t8910(@p);
+is "@p", "1 5 7", "lazy element creation with sub call";
+my @q;
+@q[0] = 1;
+@q[2] = 2;
+my @qr = \(@q);
+is $qr[$_], \$q[$_], "lazy element creation with refgen" foreach 0..2;
+isnt $qr[1], \undef, "lazy element creation with refgen";
+}
+
 "We're included by lib/Tie/Array/std.t so we need to return something true";

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-148-ga97021b9d2

2018-01-15 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/a97021b9d2cff6f0f8cbe5a5dd51187c5bad275e?hp=4d8d7a4152178168855cb6a4506025a5d82465c7>

- Log -
commit a97021b9d2cff6f0f8cbe5a5dd51187c5bad275e
Author: Zefram <zef...@fysh.org>
Date:   Tue Jan 16 05:16:41 2018 +

correct error returns from fast_abs_path()

fast_abs_path() is documented as behaving like abs_path(), and is even
used as the main version of abs_path() on Cygwin, so it should indicate
errors in the same manner.  It was croaking; change this to return undef
with $! set.  Leave croaking for the error that breaks the abs_path()
rules, where fast_abs_path() has changed cwd and fails to change back.
Problem noted on [perl #132648].

---

Summary of changes:
 dist/PathTools/Cwd.pm | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/dist/PathTools/Cwd.pm b/dist/PathTools/Cwd.pm
index c648a57c1e..451c69d3d1 100644
--- a/dist/PathTools/Cwd.pm
+++ b/dist/PathTools/Cwd.pm
@@ -462,6 +462,7 @@ my $Curdir;
 sub fast_abs_path {
 local $ENV{PWD} = $ENV{PWD} || ''; # Guard against clobberage
 my $cwd = getcwd();
+defined $cwd or return undef;
 require File::Spec;
 my $path = @_ ? shift : ($Curdir ||= File::Spec->curdir);
 
@@ -471,7 +472,9 @@ sub fast_abs_path {
 ($cwd)  = $cwd  =~ /(.*)/s;
 
 unless (-e $path) {
-   _croak("$path: No such file or directory");
+   require Errno;
+   $! = Errno::ENOENT();
+   return undef;
 }
 
 unless (-d _) {
@@ -482,7 +485,7 @@ sub fast_abs_path {
 
if (-l $path) {
my $link_target = readlink($path);
-   die "Can't resolve link $path: $!" unless defined $link_target;
+   defined $link_target or return undef;

$link_target = File::Spec->catpath($vol, $dir, $link_target)
 unless File::Spec->file_name_is_absolute($link_target);
@@ -496,7 +499,7 @@ sub fast_abs_path {
 }
 
 if (!CORE::chdir($path)) {
-   _croak("Cannot chdir to $path: $!");
+   return undef;
 }
 my $realpath = getcwd();
 if (! ((-d $cwd) && (CORE::chdir($cwd {

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-127-gfb5043174b

2018-01-10 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/fb5043174b070927d312677f0a2f04a29b11349a?hp=9969000e1134387c0ed173e5d1b3f3b760a1d00c>

- Log -
commit fb5043174b070927d312677f0a2f04a29b11349a
Author: Zefram <zef...@fysh.org>
Date:   Wed Jan 10 21:09:45 2018 +

fix Data-Dumper postentry for quoted glob

In Data-Dumper, where a glob with a quoted name required a postentry,
the name part of the postentry was being emitted as just "}".  This was
an old bug affecting upgraded glob names, which the recent commit
abda9fe0fe75ae824723761c1c98af958f17a41c made affect all quoted glob
names.  Fix the postentry name to encompass the entire quoted name.
Fixes [perl #132695].

---

Summary of changes:
 dist/Data-Dumper/Dumper.pm  |  4 ++--
 dist/Data-Dumper/Dumper.xs  | 11 ++-
 dist/Data-Dumper/t/dumper.t | 32 +++-
 3 files changed, 39 insertions(+), 8 deletions(-)

diff --git a/dist/Data-Dumper/Dumper.pm b/dist/Data-Dumper/Dumper.pm
index 41433fc533..00c99ec0f2 100644
--- a/dist/Data-Dumper/Dumper.pm
+++ b/dist/Data-Dumper/Dumper.pm
@@ -10,7 +10,7 @@
 package Data::Dumper;
 
 BEGIN {
-$VERSION = '2.169'; # Don't forget to set version and release
+$VERSION = '2.170'; # Don't forget to set version and release
 }   # date in POD below!
 
 #$| = 1;
@@ -1474,7 +1474,7 @@ modify it under the same terms as Perl itself.
 
 =head1 VERSION
 
-Version 2.169
+Version 2.170
 
 =head1 SEE ALSO
 
diff --git a/dist/Data-Dumper/Dumper.xs b/dist/Data-Dumper/Dumper.xs
index 319f00eb6d..174562ccc8 100644
--- a/dist/Data-Dumper/Dumper.xs
+++ b/dist/Data-Dumper/Dumper.xs
@@ -1314,11 +1314,11 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN 
namelen, SV *retval, HV *seenhv,
i = 0; else i -= 4;
}
 if (globname_needs_quote(c,i)) {
-   sv_grow(retval, SvCUR(retval)+2);
+   sv_grow(retval, SvCUR(retval)+3);
r = SvPVX(retval)+SvCUR(retval);
-   r[0] = '*'; r[1] = '{';
+   r[0] = '*'; r[1] = '{'; r[2] = 0;
SvCUR_set(retval, SvCUR(retval)+2);
-esc_q_utf8(aTHX_ retval, c, i,
+i = 3 + esc_q_utf8(aTHX_ retval, c, i,
 #ifdef GvNAMEUTF8
!!GvNAMEUTF8(val)
 #else
@@ -1328,15 +1328,16 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN 
namelen, SV *retval, HV *seenhv,
sv_grow(retval, SvCUR(retval)+2);
r = SvPVX(retval)+SvCUR(retval);
r[0] = '}'; r[1] = '\0';
-   i = 1;
+   SvCUR_set(retval, SvCUR(retval)+1);
+   r = r+1 - i;
}
else {
sv_grow(retval, SvCUR(retval)+i+2);
r = SvPVX(retval)+SvCUR(retval);
r[0] = '*'; strlcpy(r+1, c, SvLEN(retval));
i++;
+   SvCUR_set(retval, SvCUR(retval)+i);
}
-   SvCUR_set(retval, SvCUR(retval)+i);
 
 if (style->purity) {
static const char* const entries[] = { "{SCALAR}", "{ARRAY}", 
"{HASH}" };
diff --git a/dist/Data-Dumper/t/dumper.t b/dist/Data-Dumper/t/dumper.t
index 0c12f349e3..e09a2ddd1f 100644
--- a/dist/Data-Dumper/t/dumper.t
+++ b/dist/Data-Dumper/t/dumper.t
@@ -108,7 +108,7 @@ sub SKIP_TEST {
   ++$TNUM; print "ok $TNUM # skip $reason\n";
 }
 
-$TMAX = 456;
+$TMAX = 468;
 
 # Force Data::Dumper::Dump to use perl. We test Dumpxs explicitly by calling
 # it direct. Out here it lets us knobble the next if to test that the perl
@@ -1773,3 +1773,33 @@ EOT
   TEST (q(Data::Dumper->Dumpxs([\@globs], ["globs"])), 'globs: Dumpxs()')
 if $XS;
 }
+#
+$WANT = <<'EOT';
+#$v = {
+#  a => \*::ppp,
+#  b => \*{'::a/b'},
+#  c => \*{"::a\x{2603}b"}
+#};
+#*::ppp = {
+#  a => 1
+#};
+#*{'::a/b'} = {
+#  b => 3
+#};
+#*{"::a\x{2603}b"} = {
+#  c => 5
+#};
+EOT
+{
+  *ppp = { a => 1 };
+  *{"a/b"} = { b => 3 };
+  *{"a\x{2603}b"} = { c => 5 };
+  our $v = { a => \*ppp, b => \*{"a/b"}, c => \*{"a\x{2603}b"} };
+  local $Data::Dumper::Purity = 1;
+  TEST (q(Data::Dumper->Dump([$v], ["v"])), 'glob purity: Dump()');
+  TEST (q(Data::Dumper->Dumpxs([$v], ["v"])), 'glob purity: Dumpxs()') if $XS;
+  $WANT =~ tr/'/"/;
+  local $Data::Dumper::Useqq = 1;
+  TEST (q(Data::Dumper->Dump([$v], ["v"])), 'glob purity: Dump()');
+  TEST (q(Data::Dumper->Dumpxs([$v], ["v"])), 'glob purity: Dumpxs()') if $XS;
+}

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-105-g3753712389

2018-01-02 Thread Zefram
In perl.git, the branch blead has been updated



- Log -
commit 37537123896a527fb35f766e0ddaaacb49c38dc1
Author: Niko Tyni 
Date:   Sat Sep 16 11:24:18 2017 +0300

Add missing newline to the "Unable to flush stdout" diagnostic

Originally reported by Jakub Wilk.

Bug-Debian: https://bugs.debian.org/875361

---

Summary of changes:
 perl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/perl.c b/perl.c
index 0b3ffcfcf0..a27798e063 100644
--- a/perl.c
+++ b/perl.c
@@ -696,7 +696,7 @@ perl_destruct(pTHXx)
 if (*stdo && PerlIO_flush(stdo)) {
 PerlIO_restore_errno(stdo);
 if (errno)
-PerlIO_printf(PerlIO_stderr(), "Unable to flush stdout: %s",
+PerlIO_printf(PerlIO_stderr(), "Unable to flush stdout: %s\n",
 Strerror(errno));
 if (!STATUS_UNIX)
 STATUS_ALL_FAILURE;

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-85-gdce3f5c3fd

2017-12-30 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/dce3f5c3fd788f1c2e451e3760f05a347c949eff?hp=e2bcc7d7ec67c661405135f9b00232631a97f2fb>

- Log -
commit dce3f5c3fd788f1c2e451e3760f05a347c949eff
Author: Zefram <zef...@fysh.org>
Date:   Sat Dec 30 12:36:54 2017 +

assert nested CV existence when freeing CV

[perl #131631] has a convoluted test case that messes up parser error
recovery and causes a segv via null pointer dereference.  Turn the segv
into an assertion failure, by asserting non-nullness of the pointer.
This doesn't fix the actual problem with error recovery.

---

Summary of changes:
 pad.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/pad.c b/pad.c
index d1311e2e0b..6ec2e89709 100644
--- a/pad.c
+++ b/pad.c
@@ -395,9 +395,11 @@ Perl_cv_undef_flags(pTHX_ CV *cv, U32 flags)
if (name && PadnamePV(name) && *PadnamePV(name) == '&')
{
CV * const innercv = MUTABLE_CV(curpad[ix]);
-   U32 inner_rc = SvREFCNT(innercv);
-   assert(inner_rc);
+   U32 inner_rc;
+   assert(innercv);
assert(SvTYPE(innercv) != SVt_PVFM);
+   inner_rc = SvREFCNT(innercv);
+   assert(inner_rc);
 
if (SvREFCNT(comppad) < 2) { /* allow for /(?{ sub{} 
})/  */
curpad[ix] = NULL;

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-84-ge2bcc7d7ec

2017-12-30 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/e2bcc7d7ec67c661405135f9b00232631a97f2fb?hp=5c81f85b39b1ff1ac0478af6090841369b654d7b>

- Log -
commit e2bcc7d7ec67c661405135f9b00232631a97f2fb
Author: Zefram <zef...@fysh.org>
Date:   Sat Dec 30 11:48:00 2017 +

clarify doc of "-m" et al

Expand perlrun's documentation of module-loading options.  Rather than
describe the options only in terms of C declarations, also describe
their effects in terms of module loading operations.  Fixes [perl #131518].

---

Summary of changes:
 pod/perlrun.pod | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/pod/perlrun.pod b/pod/perlrun.pod
index a50ebe2944..8f15bc2c98 100644
--- a/pod/perlrun.pod
+++ b/pod/perlrun.pod
@@ -663,14 +663,19 @@ X<-m> X<-M>
 =item B<-[mM]>[B<->]I

[perl.git] branch blead updated. v5.27.7-73-g3e6fc602e4

2017-12-29 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/3e6fc602e433dbd76941ac0ef7a438a77fbe9a05?hp=7896dde7482a2851e73f0ac2c32d1c71f6e97dca>

- Log -
commit 3e6fc602e433dbd76941ac0ef7a438a77fbe9a05
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 29 13:51:29 2017 +

perldelta for smartmatch reversion

---

Summary of changes:
 pod/perldelta.pod | 8 
 1 file changed, 8 insertions(+)

diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index fdc8016f62..a4c3154ce6 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -70,6 +70,14 @@ XXX For a release on a stable branch, this section aspires 
to be:
 
 [ List each incompatible change as a =head2 entry ]
 
+=head2 Smartmatch and switch reversion
+
+The changes to the experimental smart match operator (C<~~>) and switch
+(C/C) constructs that were made in Perl 5.27.7 have been
+reverted due to the extent of the trouble caused to CPAN modules.
+It is expected that smartmatch will be changed again in the future,
+but preceded by some kind of explicit deprecation.
+
 =head1 Deprecations
 
 XXX Any deprecated features, syntax, modules etc. should be listed here.

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-72-g7896dde748

2017-12-29 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/7896dde7482a2851e73f0ac2c32d1c71f6e97dca?hp=0c50e9158896a33f8e2c4ec35ba33d7eff021f08>

- Log -
commit 7896dde7482a2851e73f0ac2c32d1c71f6e97dca
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 29 12:39:31 2017 +

revert smartmatch to 5.27.6 behaviour

The pumpking has determined that the CPAN breakage caused by changing
smartmatch [perl #132594] is too great for the smartmatch changes to
stay in for 5.28.

This reverts most of the merge in commit
da4e040f42421764ef069371d77c008e6b801f45.  All core behaviour and
documentation is reverted.  The removal of use of smartmatch from a couple
of tests (that aren't testing smartmatch) remains.  Customisation of
a couple of CPAN modules to make them portable across smartmatch types
remains.  A small bugfix in scope.c also remains.

commit 14e4cec412927f1f65c5d2b21526e01b33029447
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 29 12:19:49 2017 +

make experimental.pm test agnostic about switch

Anticipating imminent reversion of smartmatch behaviour, make
experimental.pm able to test against either version of the switch feature,
detecting empirically which version the running perl supports.

commit 569476d57eacdb842220890e4e01ad479ec3667e
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 29 12:16:52 2017 +

make autodie more agnostic about smartmatch

Instead of saying that smartmatch lhs overloading no longer works, say
that it is likely to not work in the future.  This makes it accurate for
the upcoming reversion of smartmatch behaviour, while remaining usefully
open to this kind of smartmatch change in the future.

---

Summary of changes:
 MANIFEST  |3 -
 cop.h |   24 +-
 cpan/autodie/lib/autodie/exception.pm |   11 +-
 cpan/experimental/t/basic.t   |   39 +-
 dump.c|4 +-
 embed.fnc |   24 +-
 embed.h   |   20 +-
 ext/B/B.pm|2 +-
 ext/B/t/f_map.t   |4 +-
 ext/B/t/optree_samples.t  |   20 +-
 ext/Opcode/Opcode.pm  |8 +-
 ext/Pod-Functions/Functions_pm.PL |2 +-
 ext/Pod-Functions/t/Functions.t   |2 +-
 gv.c  |5 +-
 inline.h  |   47 +-
 keywords.c|  181 ++--
 keywords.h|  467 +-
 lib/B/Deparse-core.t  |6 +-
 lib/B/Deparse.pm  |   65 +-
 lib/B/Deparse.t   |   54 +-
 lib/B/Op_private.pm   |   10 +-
 lib/feature.pm|4 +-
 lib/overload.pm   |   31 +-
 lib/overload.t|   12 +-
 op.c  |  302 +-
 op.h  |3 +
 opcode.h  |  280 +++---
 opnames.h |  358 +++
 perl.h|   11 +-
 perly.act |  838 +
 perly.h   |   93 +-
 perly.tab | 1640 +
 perly.y   |   24 +-
 pod/perldiag.pod  |   80 +-
 pod/perlexperiment.pod|8 +-
 pod/perlfunc.pod  |   56 +-
 pod/perlintro.pod |4 +-
 pod/perlop.pod|  298 +-
 pod/perlrun.pod   |1 +
 pod/perlsyn.pod   |  529 ---
 pod/perltrap.pod  |5 +-
 pp_ctl.c  |  689 +-
 pp_proto.h|6 +-
 proto.h   |   64 +-
 regen/feature.pl  |4 +-
 regen/keywords.pl |   10 +-
 regen/op_private  |1 +
 regen/opcodes |   10 +-
 scope.c   |1 -
 sv.c  |7 +-
 t/lib/croak/pp_ctl|   12 +-
 t/lib/feature/switch  |  104 ++-
 t/lib/warnings/9uninit|7 +
 t/lib/warnings/op |2 +-
 t/lib/warnings/utf8   |5 +-
 t/op/coreamp.t|   20 +-
 t/op/coresubs.t   |2 +-
 t/op/cproto.t |7 +-
 t/op/given.t  |  238 -
 t/op/smartmatch.t |  661 +++

[perl.git] branch blead updated. v5.27.7-59-g857320cbf8

2017-12-27 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/857320cbf85e762add18885ae8a197b5e0c21b69?hp=a80cfface4daf4b6d14958a47dc54aa7cc255ae2>

- Log -
commit 857320cbf85e762add18885ae8a197b5e0c21b69
Author: Zefram <zef...@fysh.org>
Date:   Wed Dec 27 21:13:59 2017 +

postpone perl_parse() exit(0) bugfix

Commit 0301e899536a22752f40481d8a1d141b7a7dda82 fixed a long-standing
bug regarding exit(0) during perl_parse().  This turned out to cause
enough trouble to Module::Install, which accidentally relies on the
bug, that the pumpking wants more time to roll out the fix to affected
CPAN distros.  So make perl_parse() once again return 0 for an exit(0).
Reintroduces [perl #2754]; addresses [perl #132577].

---

Summary of changes:
 perl.c| 27 +++
 pod/perldelta.pod |  9 +
 t/op/blocks.t |  6 +++---
 3 files changed, 31 insertions(+), 11 deletions(-)

diff --git a/perl.c b/perl.c
index e76081354c..0b3ffcfcf0 100644
--- a/perl.c
+++ b/perl.c
@@ -1638,13 +1638,16 @@ For historical reasons, the non-zero return value also 
attempts to
 be a suitable value to pass to the C library function C (or to
 return from C), to serve as an exit code indicating the nature
 of the way initialisation terminated.  However, this isn't portable,
-due to differing exit code conventions.  An attempt is made to return
-an exit code of the type required by the host operating system, but
-because it is constrained to be non-zero, it is not necessarily possible
-to indicate every type of exit.  It is only reliable on Unix, where a
-zero exit code can be augmented with a set bit that will be ignored.
-In any case, this function is not the correct place to acquire an exit
-code: one should get that from L.
+due to differing exit code conventions.  A historical bug is preserved
+for the time being: if the Perl built-in C is called during this
+function's execution, with a type of exit entailing a zero exit code
+under the host operating system's conventions, then this function
+returns zero rather than a non-zero value.  This bug, [perl #2754],
+leads to C being called (and therefore C blocks and the
+main program running) despite a call to C.  It has been preserved
+because a popular module-installing module has come to rely on it and
+needs time to be fixed.  This issue is [perl #132577], and the original
+bug is due to be fixed in Perl 5.30.
 
 =cut
 */
@@ -1853,7 +1856,15 @@ perl_parse(pTHXx_ XSINIT_t xsinit, int argc, char 
**argv, char **env)
call_list(oldscope, PL_checkav);
}
ret = STATUS_EXIT;
-   if (ret == 0) ret = 0x100;
+   if (ret == 0) {
+   /*
+* At this point we should do
+* ret = 0x100;
+* to avoid [perl #2754], but that bugfix has been postponed
+* because of the Module::Install breakage it causes
+* [perl #132577].
+*/
+   }
break;
 case 3:
PerlIO_printf(Perl_error_log, "panic: top_env\n");
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 9459525f32..1a90b33d84 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -406,6 +406,15 @@ platform specific bugs also go here.
 
 XXX
 
+=item *
+
+The bugfix for [perl #2754] in Perl 5.27.7 turned out to cause so much
+trouble on CPAN [perl #132577] that it is being postponed.  The bug has
+been restored, so C<exit(0)> in a C or C block now
+once again permits the main program to run, and C<exit(0)> in a C
+block once again permits C blocks to run before exiting.  The bug
+will be fixed again for Perl 5.30.
+
 =back
 
 =head1 Errata From Previous Releases
diff --git a/t/op/blocks.t b/t/op/blocks.t
index f1e1a27a60..a4f9633739 100644
--- a/t/op/blocks.t
+++ b/t/op/blocks.t
@@ -149,13 +149,13 @@ fresh_perl_is('END { print "ok\n" } INIT { bless {} and 
exit }', "ok\n",
 # [perl #2754] exit(0) didn't exit from inside a UNITCHECK or CHECK block
 my $testblocks = join(" ", "BEGIN { \$| = 1; }", (map { "@{[uc($_)]} { print 
\"$_\\n\"; }" } qw(begin unitcheck check init end)), "print \"main\\n\";");
 fresh_perl_is($testblocks, "begin\nunitcheck\ncheck\ninit\nmain\nend", {}, 
'blocks execute in right order');
-fresh_perl_is("$testblocks BEGIN { exit 0; }", "begin\nunitcheck\ncheck\nend", 
{}, "BEGIN{exit 0} should exit");
+fresh_perl_is("$testblocks BEGIN { exit 0; }", 
"begin\nunitcheck\ncheck\ninit\nend", {}, "BEGIN{exit 0} doesn't exit yet");
 fresh_perl_is("$testblocks BEGIN { exit 1; }", "begin\nunitcheck\ncheck\nend", 
{}, "BEGIN{exit 1} should exit");
 fresh_perl_like

[perl.git] branch blead updated. v5.27.7-53-g815d526fdd

2017-12-25 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/815d526fdd295b59d805cd4c2871b7a3604247b1?hp=dc3c11c5b3d54ab8fc396c19fa05e08481207107>

- Log -
commit 815d526fdd295b59d805cd4c2871b7a3604247b1
Author: Zefram <zef...@fysh.org>
Date:   Tue Dec 26 07:46:35 2017 +

avoid infinite recursion in _perl_abs_path()

If _perl_abs_path() couldn't opendir("..") then it would call
File::Spec->rel2abs, which was liable to call back to Cwd::getcwd() and
thus to _perl_abs_path(), producing an infinite recursion.  The call to
File::Spec->rel2abs is of dubious value anyway, so just turn that into
an error return.  Fixes [perl #132651].

---

Summary of changes:
 dist/PathTools/Cwd.pm | 4 +---
 dist/PathTools/t/cwd_enoent.t | 2 --
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/dist/PathTools/Cwd.pm b/dist/PathTools/Cwd.pm
index d6c65e9d3a..c648a57c1e 100644
--- a/dist/PathTools/Cwd.pm
+++ b/dist/PathTools/Cwd.pm
@@ -421,9 +421,7 @@ sub _perl_abs_path
local *PARENT;
unless (opendir(PARENT, $dotdots))
{
-   # probably a permissions issue.  Try the native command.
-   require File::Spec;
-   return File::Spec->rel2abs( $start, _backtick_pwd() );
+   return undef;
}
unless (@cst = stat($dotdots))
{
diff --git a/dist/PathTools/t/cwd_enoent.t b/dist/PathTools/t/cwd_enoent.t
index 9980dfd677..59e3612568 100644
--- a/dist/PathTools/t/cwd_enoent.t
+++ b/dist/PathTools/t/cwd_enoent.t
@@ -1,8 +1,6 @@
 use warnings;
 use strict;
 
-use Test::More skip_all => "infinite loop seen on FreeBSD [perl #132651]";
-
 use Config;
 use Errno qw(ENOENT);
 use File::Temp qw(tempdir);

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-48-g06c214d653

2017-12-24 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/06c214d653ac955e506914a26f8f9ab8917a6f41?hp=dfc19b6b816537362c9de2b1a5ddb8f7107f606c>

- Log -
commit 06c214d653ac955e506914a26f8f9ab8917a6f41
Author: Zefram <zef...@fysh.org>
Date:   Mon Dec 25 06:07:26 2017 +

disable cwd_enoent test

This test, running getcwd() when cwd is an unlinked directory, was
observed to cause an infinite memory-eating loop on FreeBSD.  As a
temporary measure it must be disabled.  [perl #132651]

---

Summary of changes:
 dist/PathTools/t/cwd_enoent.t | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/dist/PathTools/t/cwd_enoent.t b/dist/PathTools/t/cwd_enoent.t
index 59e3612568..9980dfd677 100644
--- a/dist/PathTools/t/cwd_enoent.t
+++ b/dist/PathTools/t/cwd_enoent.t
@@ -1,6 +1,8 @@
 use warnings;
 use strict;
 
+use Test::More skip_all => "infinite loop seen on FreeBSD [perl #132651]";
+
 use Config;
 use Errno qw(ENOENT);
 use File::Temp qw(tempdir);

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-33-gd2e38af7de

2017-12-24 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/d2e38af7de734aa1e317de7166c6995e432e2f30?hp=e7e8ce8540f1612023d46e27e60ff002d8ab5dd7>

- Log -
commit d2e38af7de734aa1e317de7166c6995e432e2f30
Author: Zefram <zef...@fysh.org>
Date:   Sun Dec 24 11:09:54 2017 +

correct error returns from _perl_abs_path()

The perl implementation of abs_path(), and hence of getcwd(), was
returning an empty string on error, and sending a diagnostic to stderr.
The diagnostic for failing to find a directory in its parent included a
bogus $! value.  This differed from the XS version, which returns undef
with $! set appropriately.  The documentation, not explicit on the topic,
suggests that errors should be signalled more like what the XS was doing.

Resolve the discrepancy by changing the perl implementation to signal
errors by returning undef with $! set appropriately.  Document getcwd()
and abs_path() as doing this.

Fixes [perl #132648].

---

Summary of changes:
 MANIFEST  |  1 +
 dist/PathTools/Cwd.pm | 21 +---
 dist/PathTools/lib/File/Spec.pm   |  2 +-
 dist/PathTools/lib/File/Spec/AmigaOS.pm   |  2 +-
 dist/PathTools/lib/File/Spec/Cygwin.pm|  2 +-
 dist/PathTools/lib/File/Spec/Epoc.pm  |  2 +-
 dist/PathTools/lib/File/Spec/Functions.pm |  2 +-
 dist/PathTools/lib/File/Spec/Mac.pm   |  2 +-
 dist/PathTools/lib/File/Spec/OS2.pm   |  2 +-
 dist/PathTools/lib/File/Spec/Unix.pm  |  2 +-
 dist/PathTools/lib/File/Spec/VMS.pm   |  2 +-
 dist/PathTools/lib/File/Spec/Win32.pm |  2 +-
 dist/PathTools/t/cwd_enoent.t | 42 +++
 13 files changed, 65 insertions(+), 19 deletions(-)
 create mode 100644 dist/PathTools/t/cwd_enoent.t

diff --git a/MANIFEST b/MANIFEST
index c702237908..e69efd8857 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -3632,6 +3632,7 @@ dist/PathTools/Makefile.PL
makefile writer for Cwd
 dist/PathTools/t/abs2rel.t See if File::Spec->abs2rel works
 dist/PathTools/t/crossplatform.t   See if File::Spec works 
crossplatform
 dist/PathTools/t/cwd.t See if Cwd works
+dist/PathTools/t/cwd_enoent.t  See if getcwd errors correctly
 dist/PathTools/t/Functions.t   See if File::Spec::Functions 
works
 dist/PathTools/t/rel2abs2rel.t See if File::Spec->rel2abs/abs2rel works
 dist/PathTools/t/Spec.tSee if File::Spec works
diff --git a/dist/PathTools/Cwd.pm b/dist/PathTools/Cwd.pm
index 1f94997c7e..d6c65e9d3a 100644
--- a/dist/PathTools/Cwd.pm
+++ b/dist/PathTools/Cwd.pm
@@ -3,7 +3,7 @@ use strict;
 use Exporter;
 
 
-our $VERSION = '3.71';
+our $VERSION = '3.72';
 my $xs_version = $VERSION;
 $VERSION =~ tr/_//d;
 
@@ -387,8 +387,7 @@ sub _perl_abs_path
 
 unless (@cst = stat( $start ))
 {
-   _carp("stat($start): $!");
-   return '';
+   return undef;
 }
 
 unless (-d _) {
@@ -428,9 +427,10 @@ sub _perl_abs_path
}
unless (@cst = stat($dotdots))
{
-   _carp("stat($dotdots): $!");
+   my $e = $!;
closedir(PARENT);
-   return '';
+   $! = $e;
+   return undef;
}
if ($pst[0] == $cst[0] && $pst[1] == $cst[1])
{
@@ -442,9 +442,10 @@ sub _perl_abs_path
{
unless (defined ($dir = readdir(PARENT)))
{
-   _carp("readdir($dotdots): $!");
closedir(PARENT);
-   return '';
+   require Errno;
+   $! = Errno::ENOENT();
+   return undef;
}
$tst[0] = $pst[0]+1 unless (@tst = lstat("$dotdots/$dir"))
}
@@ -701,7 +702,8 @@ absolute path of the current working directory.
 
 my $cwd = getcwd();
 
-Returns the current working directory.
+Returns the current working directory.  On error returns C,
+with C<$!> set to indicate the error.
 
 Exposes the POSIX function getcwd(3) or re-implements it if it's not
 available.
@@ -764,7 +766,8 @@ given they'll use the current working directory.
 
 Uses the same algorithm as getcwd().  Symbolic links and relative-path
 components ("." and "..") are resolved to return the canonical
-pathname, just like realpath(3).
+pathname, just like realpath(3).  On error returns C, with C<$!>
+set to indicate the error.
 
 =item realpath
 
diff --git a/dist/PathTools/lib/File/Spec.pm b/dist/PathTools/lib/File/Spec.pm
index 5a53413124..ca90b9e610 100644
--- a/dist/PathTools/lib/File/Spec.pm
+++ b/dist/PathTools/lib/File/Spec.pm

[perl.git] branch blead updated. v5.27.7-32-ge7e8ce8540

2017-12-23 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/e7e8ce8540f1612023d46e27e60ff002d8ab5dd7?hp=5e979393c70aea85c7e746cb74286755c4e720f4>

- Log -
commit e7e8ce8540f1612023d46e27e60ff002d8ab5dd7
Author: Zefram <zef...@fysh.org>
Date:   Sat Dec 23 16:02:51 2017 +

describe encoding status of DATA handle

---

Summary of changes:
 pod/perldata.pod | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/pod/perldata.pod b/pod/perldata.pod
index c0463fc388..d03fe25773 100644
--- a/pod/perldata.pod
+++ b/pod/perldata.pod
@@ -619,6 +619,17 @@ introduced, __END__ behaves like __DATA__ in the top level 
script (but
 not in files loaded with C or C) and leaves the remaining
 contents of the file accessible via C.
 
+The C file handle by default has whatever PerlIO layers were
+in place when Perl read the file to parse the source.  Normally that
+means that the file is being read bytewise, as if it were encoded in
+Latin-1, but there are two major ways for it to be otherwise.  Firstly,
+if the C<__END__>/C<__DATA__> token is in the scope of a C
+pragma then the C handle will be in UTF-8 mode.  And secondly,
+if the source is being read from perl's standard input then the C
+file handle is actually aliased to the C file handle, and may
+be in UTF-8 mode because of the C environment variable or
+perl's command-line switches.
+
 See L for more description of __DATA__, and
 an example of its use.  Note that you cannot read from the DATA
 filehandle in a BEGIN block: the BEGIN block is executed as soon

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-31-g5e979393c7

2017-12-23 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/5e979393c70aea85c7e746cb74286755c4e720f4?hp=049809883fe65af212c1837f94e2256d13de60ac>

- Log -
commit 5e979393c70aea85c7e746cb74286755c4e720f4
Author: Zefram <zef...@fysh.org>
Date:   Sat Dec 23 11:50:52 2017 +

better document while condition magic

The operators affected by while-condition magic variously didn't mention
the implicit "defined" part of the magic or didn't mention it at all.
In perlsyn.pod there was a partial mention of the magic in the context
of the "for" loop, but none for the "while" loop.  Describe the magic
more fully on both ends.  [perl #132644]

commit 1a267a5111f1c4b1395ae3696820f177bf25b7c0
Author: Zefram <zef...@fysh.org>
Date:   Sat Dec 23 10:57:51 2017 +

better doc of hash/array iterators

Expand L with slightly more explicit description of the
sharing of iterator state, and with caveats regarding the fragility of
while-each loops.  [perl #132644]

---

Summary of changes:
 pod/perlfunc.pod | 40 +++-
 pod/perlop.pod   | 14 --
 pod/perlsyn.pod  | 26 ++
 3 files changed, 69 insertions(+), 11 deletions(-)

diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 01077cdb59..901d5c87e1 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -1947,7 +1947,8 @@ its own internal iterator, accessed by L<C|/each 
HASH>,
 L<C|/keys HASH>, and L<C|/values HASH>.  The iterator is
 implicitly reset when L<C|/each HASH> has reached the end as just
 described; it can be explicitly reset by calling L<C|/keys HASH>
-or L<C|/values HASH> on the hash or array.  If you add or delete
+or L<C|/values HASH> on the hash or array, or by referencing
+the hash (but not array) in list context.  If you add or delete
 a hash's elements while iterating over it, the effect on the iterator is
 unspecified; for example, entries may be skipped or duplicated--so don't
 do that.  Exception: It is always safe to delete the item most recently
@@ -1961,6 +1962,21 @@ returned by L<C|/each HASH>, so the following code 
works properly:
 Tied hashes may have a different ordering behaviour to perl's hash
 implementation.
 
+The iterator used by C is attached to the hash or array, and is
+shared between all iteration operations applied to the same hash or array.
+Thus all uses of C on a single hash or array advance the same
+iterator location.  All uses of C are also subject to having the
+iterator reset by any use of C or C on the same hash or
+array, or by the hash (but not array) being referenced in list context.
+This makes C-based loops quite fragile: it is easy to arrive at
+such a loop with the iterator already part way through the object, or to
+accidentally clobber the iterator state during execution of the loop body.
+It's easy enough to explicitly reset the iterator before starting a loop,
+but there is no way to insulate the iterator state used by a loop from
+the iterator state used by anything else that might execute during the
+loop body.  To avoid these problems, use a C loop rather than
+C-C.
+
 This prints out your environment like the L<printenv(1)> program,
 but in a different order:
 
@@ -1974,6 +1990,10 @@ been deemed unsuccessful, and was removed as of Perl 
5.24.
 
 As of Perl 5.18 you can use a bare L<C|/each HASH> in a C
 loop, which will set L<C<$_>|perlvar/$_> on every iteration.
+If either an C expression or an explicit assignment of an C
+expression to a scalar is used as a C/C condition, then
+the condition actually tests for definedness of the expression's value,
+not for its regular truth value.
 
 while (each %ENV) {
print "$_=$ENV{$_}\n";
@@ -3351,6 +3371,13 @@ See L for details, including
 L<C|File::Glob/C>, which does not treat whitespace
 as a pattern separator.
 
+If a C expression is used as the condition of a C or C
+loop, then it will be implicitly assigned to C<$_>.  If either a C
+expression or an explicit assignment of a C expression to a scalar
+is used as a C/C condition, then the condition actually
+tests for definedness of the expression's value, not for its regular
+truth value.
+
 Portability issues: L.
 
 =item gmtime EXPR
@@ -6104,6 +6131,10 @@ it would have been testing the wrong file.
 
 As of Perl 5.12 you can use a bare L<C|/readdir DIRHANDLE> in a
 C loop, which will set L<C<$_>|perlvar/$_> on every iteration.
+If either a C expression or an explicit assignment of a
+C expression to a scalar is used as a C/C condition,
+then the condition actually tests for definedness of the expression's
+value, not for its regular truth value.
 

[perl.git] branch blead updated. v5.27.7-29-g049809883f

2017-12-23 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/049809883fe65af212c1837f94e2256d13de60ac?hp=b98da25d1df8fcfc0b2bcb79d46a7624d3d98ea5>

- Log -
commit 049809883fe65af212c1837f94e2256d13de60ac
Author: Zefram <zef...@fysh.org>
Date:   Sat Dec 23 09:07:50 2017 +

narrow scope of argsv in sv_vcatpvfn_flags()

argsv was being retained between format specifiers, causing incorrect
treatment of format specifiers following one that took an SV argument.
Fixes [perl #132645].

---

Summary of changes:
 sv.c  | 2 +-
 t/lib/warnings/op | 7 +++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/sv.c b/sv.c
index 7e3987cc98..a79c033a3d 100644
--- a/sv.c
+++ b/sv.c
@@ -11814,7 +11814,6 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char 
*const pat, const STRLEN p
 STRLEN origlen;
 Size_t svix = 0;
 static const char nullstr[] = "(null)";
-SV *argsv = NULL;
 bool has_utf8 = DO_UTF8(sv);/* has the result utf8? */
 const bool pat_utf8 = has_utf8; /* the pattern is in utf8? */
 /* Times 4: a decimal digit takes more than 3 binary digits.
@@ -11919,6 +11918,7 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char 
*const pat, const STRLEN p
Size_t efix  = 0; /* explicit format parameter index */
const Size_t osvix  = svix;   /* original index in case of bad fmt */
 
+   SV *argsv= NULL;
bool is_utf8 = FALSE; /* is this item utf8?   */
 bool arg_missing = FALSE; /* give "Missing argument" warning */
char esignbuf[4]; /* holds sign prefix, e.g. "-0x" */
diff --git a/t/lib/warnings/op b/t/lib/warnings/op
index 23e03dfb63..52ef3781cd 100644
--- a/t/lib/warnings/op
+++ b/t/lib/warnings/op
@@ -189,6 +189,13 @@ Scalar value @a[...] better written as $a[...] at - line 
13.
 Scalar value @a{...} better written as $a{...} at - line 14.
 
 # op.c
+# [perl #132645]
+use warnings 'syntax';
+@inf[3];
+EXPECT
+Scalar value @inf[3] better written as $inf[3] at - line 4.
+
+# op.c
 use utf8;
 use open qw( :utf8 :std );
 use warnings 'syntax' ;

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-28-gb98da25d1d

2017-12-22 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/b98da25d1df8fcfc0b2bcb79d46a7624d3d98ea5?hp=50a85cfe6c852deb0c2f738cb82006623052dc8e>

- Log -
commit b98da25d1df8fcfc0b2bcb79d46a7624d3d98ea5
Author: Zefram <zef...@fysh.org>
Date:   Sat Dec 23 05:47:55 2017 +

make false whereso yield undef in scalar context

Fixes [perl #132634].

---

Summary of changes:
 pp_ctl.c   |  5 -
 t/op/whereis.t | 12 +++-
 t/op/whereso.t | 12 +++-
 3 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/pp_ctl.c b/pp_ctl.c
index a0cb31ccf6..a97761d999 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -4616,8 +4616,11 @@ PP(pp_enterwhereso)
to the op that follows the leavewhereso.
RETURNOP calls PUTBACK which restores the stack pointer after the POPs.
 */
-if (!SvTRUEx(POPs))
+if (!SvTRUEx(POPs)) {
+   if (gimme == G_SCALAR)
+   PUSHs(_sv_undef);
RETURNOP(cLOGOP->op_other->op_next);
+}
 
 cx = cx_pushblock(CXt_WHERESO, gimme, SP, PL_savestack_ix);
 cx_pushwhereso(cx);
diff --git a/t/op/whereis.t b/t/op/whereis.t
index 522e7d8661..c5bc778334 100644
--- a/t/op/whereis.t
+++ b/t/op/whereis.t
@@ -9,7 +9,7 @@ use strict;
 use warnings;
 no warnings qw(uninitialized experimental::smartmatch);
 
-plan tests => 19;
+plan tests => 21;
 
 foreach(3) {
 CORE::whereis(qr/\A3\z/) {
@@ -75,4 +75,14 @@ foreach my $matcher ($matchabc, $regexpabc) {
 }
 }
 
+foreach("xyz") {
+no warnings "void";
+my @a = (qw(a b c), do { whereis($matchabc) { qw(x y) } }, qw(d e f));
+is join(",", map { $_ // "u" } @a), "a,b,c,d,e,f",
+   "list value of false whereis";
+@a = (qw(a b c), scalar do { whereis($matchabc) { qw(x y) } }, qw(d e f));
+is join(",", map { $_ // "u" } @a), "a,b,c,u,d,e,f",
+   "scalar value of false whereis";
+}
+
 1;
diff --git a/t/op/whereso.t b/t/op/whereso.t
index 15d29a80e1..992ecf740e 100644
--- a/t/op/whereso.t
+++ b/t/op/whereso.t
@@ -10,7 +10,7 @@ use strict;
 use warnings;
 no warnings 'experimental::smartmatch';
 
-plan tests => 42;
+plan tests => 44;
 
 foreach(3) {
 CORE::whereso(3) {
@@ -204,4 +204,14 @@ $act = "";
 }
 is $act, "[a][c][d]";
 
+{
+no warnings "void";
+my @a = (qw(a b c), do { whereso(0) { qw(x y) } }, qw(d e f));
+is join(",", map { $_ // "u" } @a), "a,b,c,d,e,f",
+   "list value of false whereso";
+@a = (qw(a b c), scalar do { whereso(0) { qw(x y) } }, qw(d e f));
+is join(",", map { $_ // "u" } @a), "a,b,c,u,d,e,f",
+   "scalar value of false whereso";
+}
+
 1;

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-9-g8e920bd341

2017-12-22 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/8e920bd341e241f50a74dbf8aa343319f204e200?hp=503bc07b4b9e34ed04a725b2bc8faec1ae0f3be2>

- Log -
commit 8e920bd341e241f50a74dbf8aa343319f204e200
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 22 10:07:47 2017 +

set PERL_EXIT_DESTRUCT_END in all embeddings

The new tests in commit 503bc07b4b9e34ed04a725b2bc8faec1ae0f3be2
showed up platform differences in whether END blocks get run.
Set PERL_EXIT_DESTRUCT_END in all embeddings to make this consistent.

---

Summary of changes:
 NetWare/interface.c   | 1 +
 NetWare/interface.cpp | 1 +
 os2/perlrexx.c| 1 +
 symbian/PerlBase.cpp  | 4 
 win32/perllib.c   | 1 +
 5 files changed, 8 insertions(+)

diff --git a/NetWare/interface.c b/NetWare/interface.c
index 1d298854c9..b943d21147 100644
--- a/NetWare/interface.c
+++ b/NetWare/interface.c
@@ -62,6 +62,7 @@ ClsPerlHost::PerlCreate(PerlInterpreter *my_perl)
 /* if (!(my_perl = perl_alloc()))  // Allocate memory for Perl.
return (1);*/
 perl_construct(my_perl);
+PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
 
return 1;
 }
diff --git a/NetWare/interface.cpp b/NetWare/interface.cpp
index b08d6c249e..7fe027933c 100644
--- a/NetWare/interface.cpp
+++ b/NetWare/interface.cpp
@@ -53,6 +53,7 @@ ClsPerlHost::PerlCreate(PerlInterpreter *my_perl)
 /* if (!(my_perl = perl_alloc()))  // Allocate memory for Perl.
return (1);*/
 perl_construct(my_perl);
+PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
 
return 1;
 }
diff --git a/os2/perlrexx.c b/os2/perlrexx.c
index 18d655137d..b9f6789677 100644
--- a/os2/perlrexx.c
+++ b/os2/perlrexx.c
@@ -74,6 +74,7 @@ init_perl(int doparse)
if (!my_perl)
return 0;
perl_construct(my_perl);
+   PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
PL_perl_destruct_level = 1;
 }
 if (!doparse)
diff --git a/symbian/PerlBase.cpp b/symbian/PerlBase.cpp
index 9312abeb55..88810bfd12 100644
--- a/symbian/PerlBase.cpp
+++ b/symbian/PerlBase.cpp
@@ -141,6 +141,10 @@ void CPerlBase::ConstructL()
 User::LeaveIfNull(iPerl);
 iState = EPerlAllocated;
 perl_construct(iPerl); // returns void
+{
+   PerlInterpreter *my_perl = iPerl;
+   PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
+}
 if (!iStdioInitFunc) {
 iConsole =
   Console::NewL(_L("Perl Console"),
diff --git a/win32/perllib.c b/win32/perllib.c
index 246f67aa1a..25b20156ec 100644
--- a/win32/perllib.c
+++ b/win32/perllib.c
@@ -230,6 +230,7 @@ RunPerl(int argc, char **argv, char **env)
 if (!(my_perl = perl_alloc()))
return (1);
 perl_construct(my_perl);
+PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
 PL_perl_destruct_level = 0;
 
 /* PERL_SYS_INIT() may update the environment, e.g. via ansify_path().

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-8-g503bc07b4b

2017-12-21 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/503bc07b4b9e34ed04a725b2bc8faec1ae0f3be2?hp=8fe3452cc6ac7af8c08c2044cd3757018a9c8887>

- Log -
commit 503bc07b4b9e34ed04a725b2bc8faec1ae0f3be2
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 22 07:54:38 2017 +

test more about exit from special blocks

Commit 0301e899536a22752f40481d8a1d141b7a7dda82 introduced some tests
about ways of exiting from special blocks.  Make those tests more
thorough, checking which kinds of special blocks execute after exiting
from a special block.  This tests, for example, that exiting from a BEGIN
block prevents INIT blocks from running, which when applied to exit(0)
is how that bugfix commit broke Module::Install [perl #132577].

---

Summary of changes:
 t/op/blocks.t | 26 --
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/t/op/blocks.t b/t/op/blocks.t
index fd20a45f0e..f1e1a27a60 100644
--- a/t/op/blocks.t
+++ b/t/op/blocks.t
@@ -6,7 +6,7 @@ BEGIN {
 set_up_inc('../lib');
 }
 
-plan tests => 18;
+plan tests => 22;
 
 my @expect = qw(
 b1
@@ -147,15 +147,21 @@ fresh_perl_is('END { print "ok\n" } INIT { bless {} and 
exit }', "ok\n",
   {}, 'null PL_curcop in newGP');
 
 # [perl #2754] exit(0) didn't exit from inside a UNITCHECK or CHECK block
-fresh_perl_is('BEGIN{exit 0}; print "still here"', '', {}, 'BEGIN{exit 0} 
should exit');
-fresh_perl_is('BEGIN{exit 1}; print "still here"', '', {}, 'BEGIN{exit 1} 
should exit');
-fresh_perl_like('BEGIN{die}; print "still here"', qr/\ADied[^\n]*\.\nBEGIN 
failed[^\n]*\.\z/, {}, 'BEGIN{die} should exit');
-fresh_perl_is('UNITCHECK{exit 0}; print "still here"', '', {}, 'UNITCHECK{exit 
0} should exit');
-fresh_perl_is('UNITCHECK{exit 1}; print "still here"', '', {}, 'UNITCHECK{exit 
1} should exit');
-fresh_perl_like('UNITCHECK{die}; print "still here"', 
qr/\ADied[^\n]*\.\nUNITCHECK failed[^\n]*\.\z/, {}, 'UNITCHECK{die} should 
exit');
-fresh_perl_is('CHECK{exit 0}; print "still here"', '', {}, 'CHECK{exit 0} 
should exit');
-fresh_perl_is('CHECK{exit 1}; print "still here"', '', {}, 'CHECK{exit 1} 
should exit');
-fresh_perl_like('CHECK{die}; print "still here"', qr/\ADied[^\n]*\.\nCHECK 
failed[^\n]*\.\z/, {}, 'CHECK{die} should exit');
+my $testblocks = join(" ", "BEGIN { \$| = 1; }", (map { "@{[uc($_)]} { print 
\"$_\\n\"; }" } qw(begin unitcheck check init end)), "print \"main\\n\";");
+fresh_perl_is($testblocks, "begin\nunitcheck\ncheck\ninit\nmain\nend", {}, 
'blocks execute in right order');
+fresh_perl_is("$testblocks BEGIN { exit 0; }", "begin\nunitcheck\ncheck\nend", 
{}, "BEGIN{exit 0} should exit");
+fresh_perl_is("$testblocks BEGIN { exit 1; }", "begin\nunitcheck\ncheck\nend", 
{}, "BEGIN{exit 1} should exit");
+fresh_perl_like("$testblocks BEGIN { die; }", qr/\Abegin\nDied[^\n]*\.\nBEGIN 
failed[^\n]*\.\nunitcheck\ncheck\nend\z/, {}, "BEGIN{die} should exit");
+fresh_perl_is("$testblocks UNITCHECK { exit 0; }", 
"begin\nunitcheck\ncheck\nend", {}, "UNITCHECK{exit 0} should exit");
+fresh_perl_is("$testblocks UNITCHECK { exit 1; }", 
"begin\nunitcheck\ncheck\nend", {}, "UNITCHECK{exit 1} should exit");
+fresh_perl_like("$testblocks UNITCHECK { die; }", 
qr/\Abegin\nDied[^\n]*\.\nUNITCHECK failed[^\n]*\.\nunitcheck\ncheck\nend\z/, 
{}, "UNITCHECK{die} should exit");
+fresh_perl_is("$testblocks CHECK { exit 0; }", "begin\nunitcheck\ncheck\nend", 
{}, "CHECK{exit 0} should exit");
+fresh_perl_is("$testblocks CHECK { exit 1; }", "begin\nunitcheck\ncheck\nend", 
{}, "CHECK{exit 1} should exit");
+fresh_perl_like("$testblocks CHECK { die; }", 
qr/\Abegin\nunitcheck\nDied[^\n]*\.\nCHECK failed[^\n]*\.\ncheck\nend\z/, {}, 
"CHECK{die} should exit");
+
+fresh_perl_is("$testblocks INIT { exit 0; }", 
"begin\nunitcheck\ncheck\ninit\nend", {}, "INIT{exit 0} should exit");
+fresh_perl_is("$testblocks INIT { exit 1; }", 
"begin\nunitcheck\ncheck\ninit\nend", {}, "INIT{exit 1} should exit");
+fresh_perl_like("$testblocks INIT { die; }", 
qr/\Abegin\nunitcheck\ncheck\ninit\nDied[^\n]*\.\nINIT failed[^\n]*\.\nend\z/, 
{}, "INIT{die} should exit");
 
 TODO: {
 local $TODO = 'RT #2917: INIT{} in eval is wrongly considered too late';

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-7-g8fe3452cc6

2017-12-21 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/8fe3452cc6ac7af8c08c2044cd3757018a9c8887?hp=aecacd448cd91d195bb2413fdd04568438514017>

- Log -
commit 8fe3452cc6ac7af8c08c2044cd3757018a9c8887
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 22 05:32:41 2017 +

preserve numericness of system() args on Win32

On Windows there's a nasty variation in the meaning of arguments
to Perl's system(), in which a numeric first argument isn't used as
part of the command to run, but instead selects between two different
operations to perform with the command (whether to wait for the command
to complete or not).  Therefore the reduction of argument scalars to
their operative values in the parent process, which was added in commit
64def2aeaeb63f92dadc6dfa33486c1d7b311963, needs to preserve numericness
of arguments on Windows.  Fixes [perl #132633].

---

Summary of changes:
 pp_sys.c | 35 +++
 1 file changed, 31 insertions(+), 4 deletions(-)

diff --git a/pp_sys.c b/pp_sys.c
index beb60da4c6..0649794104 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -4393,12 +4393,39 @@ PP(pp_system)
 # endif
 
 while (++MARK <= SP) {
-   SV *origsv = *MARK;
+   SV *origsv = *MARK, *copysv;
STRLEN len;
char *pv;
-   pv = SvPV(origsv, len);
-   *MARK = newSVpvn_flags(pv, len,
-   (SvFLAGS(origsv) & SVf_UTF8) | SVs_TEMP);
+   SvGETMAGIC(origsv);
+#ifdef WIN32
+   /*
+* Because of a nasty platform-specific variation on the meaning
+* of arguments to this op, we must preserve numeric arguments
+* as numeric, not just retain the string value.
+*/
+   if (SvNIOK(origsv) || SvNIOKp(origsv)) {
+   copysv = newSV_type(SVt_PVNV);
+   sv_2mortal(copysv);
+   if (SvPOK(origsv) || SvPOKp(origsv)) {
+   pv = SvPV_nomg(origsv, len);
+   sv_setpvn(copysv, pv, len);
+   SvPOK_off(copysv);
+   }
+   if (SvIOK(origsv) || SvIOKp(origsv))
+   SvIV_set(copysv, SvIVX(origsv));
+   if (SvNOK(origsv) || SvNOKp(origsv))
+   SvNV_set(copysv, SvNVX(origsv));
+   SvFLAGS(copysv) |= SvFLAGS(origsv) &
+   (SVf_IOK|SVf_NOK|SVf_POK|SVp_IOK|SVp_NOK|SVp_POK|
+   SVf_UTF8|SVf_IVisUV);
+   } else
+#endif
+   {
+   pv = SvPV_nomg(origsv, len);
+   copysv = newSVpvn_flags(pv, len,
+   (SvFLAGS(origsv) & SVf_UTF8) | SVs_TEMP);
+   }
+   *MARK = copysv;
 }
 MARK = ORIGMARK;
 

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-5-gfe2024f944

2017-12-20 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/fe2024f944c63d1ef0759b7fcf1b4577462ba167?hp=946b6ed4ec08dfa012129f650bc1259f5ea1dd48>

- Log -
commit fe2024f944c63d1ef0759b7fcf1b4577462ba167
Author: Zefram <zef...@fysh.org>
Date:   Thu Dec 21 05:40:49 2017 +

fix up faulty perl embeddings

Some platform-specific embeddings of perl were misusing the
return values from perl_parse() and perl_run(), in some cases
causing failure due to exit(0) combined with the recent changes
in commit 0301e899536a22752f40481d8a1d141b7a7dda82.  Commit
d4a50999a5525c2681d59cae5fcd94f94ff897fd partially fixed a Windows
embedding.  More fully fix that, along with NetWare and OS/2.  Even in
embeddings with correct logic, stop using a variable named "exitstatus"
to hold the result of perl_parse() or perl_run(), to avoid misleading
people who copy the code.

---

Summary of changes:
 NetWare/interface.c| 15 +++
 NetWare/interface.cpp  | 16 
 NetWare/interface.h|  2 +-
 NetWare/iperlhost.h|  2 +-
 ext/ExtUtils-Miniperl/lib/ExtUtils/Miniperl.pm |  5 ++---
 miniperlmain.c |  3 +--
 os2/perlrexx.c | 12 
 pod/perlinterp.pod |  3 +--
 win32/perllib.c|  9 -
 9 files changed, 29 insertions(+), 38 deletions(-)

diff --git a/NetWare/interface.c b/NetWare/interface.c
index 29a8dc0d24..1d298854c9 100644
--- a/NetWare/interface.c
+++ b/NetWare/interface.c
@@ -78,10 +78,10 @@ ClsPerlHost::PerlRun(PerlInterpreter *my_perl)
return(perl_run(my_perl));  // Run Perl.
 }
 
-void
+int
 ClsPerlHost::PerlDestroy(PerlInterpreter *my_perl)
 {
-   perl_destruct(my_perl); // Destructor for Perl.
+   return(perl_destruct(my_perl)); // Destructor for Perl.
 }
 
 void
@@ -148,19 +148,18 @@ int RunPerl(int argc, char **argv, char **env)
{
PL_perl_destruct_level = 0;
 
-   exitstatus = nlm.PerlParse(my_perl, argc, argv, env);
-   if(exitstatus == 0)
+   if(!nlm.PerlParse(my_perl, argc, argv, env))
{
#if defined(TOP_CLONE) && defined(USE_ITHREADS) 
// XX testing
new_perl = perl_clone(my_perl, 1);
 
-   exitstatus = perl_run(new_perl);// Run 
Perl.
+   (void) perl_run(new_perl);  // Run Perl.
PERL_SET_THX(my_perl);
#else
-   exitstatus = nlm.PerlRun(my_perl);
+   (void) nlm.PerlRun(my_perl);
#endif
}
-   nlm.PerlDestroy(my_perl);
+   exitstatus = nlm.PerlDestroy(my_perl);
}
if(my_perl)
nlm.PerlFree(my_perl);
@@ -169,7 +168,7 @@ int RunPerl(int argc, char **argv, char **env)
if (new_perl)
{
PERL_SET_THX(new_perl);
-   nlm.PerlDestroy(new_perl);
+   exitstatus = nlm.PerlDestroy(new_perl);
nlm.PerlFree(my_perl);
}
#endif
diff --git a/NetWare/interface.cpp b/NetWare/interface.cpp
index aef71f9ffa..b08d6c249e 100644
--- a/NetWare/interface.cpp
+++ b/NetWare/interface.cpp
@@ -69,11 +69,12 @@ ClsPerlHost::PerlRun(PerlInterpreter *my_perl)
return(perl_run(my_perl));  // Run Perl.
 }
 
-void
+int
 ClsPerlHost::PerlDestroy(PerlInterpreter *my_perl)
 {
-   perl_destruct(my_perl); // Destructor for Perl.
+   int ret = perl_destruct(my_perl);   // Destructor for Perl.
    perl_free(my_perl); // Free the memory allocated 
for Perl.
+   return(ret);
 }
 
 void
@@ -142,8 +143,7 @@ int RunPerl(int argc, char **argv, char **env)
{
PL_perl_destruct_level = 0;
 
-   exitstatus = nlm.PerlParse(my_perl, argc, argv, env);
-   if(exitstatus == 0)
+   if(!nlm.PerlParse(my_perl, argc, argv, env))
{
#if defined(TOP_CLONE) && defined(USE_ITHREADS) 
// XX testing
#  ifdef PERL_OBJECT
@@ -164,13 +164,13 @@ int RunPerl(int argc, char **argv, char **env)
new_perl = perl_clone(my_perl, 1);
#  endif
 
-   exitstatus = perl_run(new_perl);// Run 
Perl.
+

[perl.git] branch blead updated. v5.27.6-326-gfa0964df6c

2017-12-17 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/fa0964df6c1cba184f8f09eab869e9f813174b12?hp=228483d4f7b5356f504d0ad059432594a4f2b153>

- Log -
commit fa0964df6c1cba184f8f09eab869e9f813174b12
Author: Zefram <zef...@fysh.org>
Date:   Mon Dec 18 03:21:05 2017 +

align version numbers in the PathTools distro

commit e229c0feaa828e8255bda950ed3456ef196226b3
Author: Zefram <zef...@fysh.org>
Date:   Mon Dec 18 03:18:39 2017 +

remove support for running PathTools on MacOS

MacOS Classic hasn't been a supported platform since 5.14.  Note that
the code for processing MacOS-style paths remains, and can be run on
supported platforms.  [perl #130818]

commit 39b5053954b30965e2f005f8ea1fec58c1796050
Author: Zefram <zef...@fysh.org>
Date:   Mon Dec 18 03:12:04 2017 +

fix pod markup in warnings.pm

Commit c4583f59133164b3f392c31e9b9573276ec17e74 introduced a pod error.

commit e9a5b59fedc30cba91617c6b239f9568cf4ce08e
Author: Zefram <zef...@fysh.org>
Date:   Mon Dec 18 03:08:31 2017 +

remove support for running PathTools on EPOC

EPOC hasn't been a supported platform since 5.18.  Note that the code
for processing EPOC-style paths remains, and can be run on supported
platforms.  [perl #130818]

---

Summary of changes:
 dist/PathTools/Cwd.pm | 28 +---
 dist/PathTools/lib/File/Spec.pm   |  5 ++---
 dist/PathTools/lib/File/Spec/AmigaOS.pm   |  2 +-
 dist/PathTools/lib/File/Spec/Cygwin.pm|  2 +-
 dist/PathTools/lib/File/Spec/Epoc.pm  |  2 +-
 dist/PathTools/lib/File/Spec/Functions.pm |  2 +-
 dist/PathTools/lib/File/Spec/Mac.pm   | 27 +++
 dist/PathTools/lib/File/Spec/OS2.pm   |  2 +-
 dist/PathTools/lib/File/Spec/Unix.pm  |  2 +-
 dist/PathTools/lib/File/Spec/VMS.pm   |  2 +-
 dist/PathTools/lib/File/Spec/Win32.pm |  2 +-
 lib/warnings.pm   |  4 ++--
 regen/warnings.pl |  4 ++--
 13 files changed, 18 insertions(+), 66 deletions(-)

diff --git a/dist/PathTools/Cwd.pm b/dist/PathTools/Cwd.pm
index 0f7364e17d..1f94997c7e 100644
--- a/dist/PathTools/Cwd.pm
+++ b/dist/PathTools/Cwd.pm
@@ -135,23 +135,6 @@ my %METHOD_MAP =
 realpath   => 'fast_abs_path',
},
 
-   epoc =>
-   {
-cwd=> '_epoc_cwd',
-getcwd => '_epoc_cwd',
-fastgetcwd => '_epoc_cwd',
-fastcwd=> '_epoc_cwd',
-abs_path   => 'fast_abs_path',
-   },
-
-   MacOS =>
-   {
-getcwd => 'cwd',
-fastgetcwd => 'cwd',
-fastcwd=> 'cwd',
-abs_path   => 'fast_abs_path',
-   },
-
amigaos =>
{
 getcwd  => '_backtick_pwd',
@@ -244,8 +227,7 @@ unless ($METHOD_MAP{$^O}{cwd} or defined ) {
}
 }
 
-# MacOS has some special magic to make `pwd` work.
-if( $os eq 'MacOS' || $found_pwd_cmd )
+if( $found_pwd_cmd )
 {
*cwd = \&_backtick_pwd;
 }
@@ -374,9 +356,6 @@ sub chdir {
 if ($^O eq 'VMS') {
return $ENV{'PWD'} = $ENV{'DEFAULT'}
 }
-elsif ($^O eq 'MacOS') {
-   return $ENV{'PWD'} = cwd();
-}
 elsif ($^O eq 'MSWin32') {
$ENV{'PWD'} = $newpwd;
return 1;
@@ -666,11 +645,6 @@ sub _qnx_abs_path {
 return $realpath;
 }
 
-sub _epoc_cwd {
-return $ENV{'PWD'} = EPOC::getcwd();
-}
-
-
 # Now that all the base-level functions are set up, alias the
 # user-level functions to the right places
 
diff --git a/dist/PathTools/lib/File/Spec.pm b/dist/PathTools/lib/File/Spec.pm
index 187751cca3..5a53413124 100644
--- a/dist/PathTools/lib/File/Spec.pm
+++ b/dist/PathTools/lib/File/Spec.pm
@@ -2,14 +2,13 @@ package File::Spec;
 
 use strict;
 
-our $VERSION = '3.70';
+our $VERSION = '3.71';
 $VERSION =~ tr/_//d;
 
-my %module = (MacOS   => 'Mac',
+my %module = (
  MSWin32 => 'Win32',
  os2 => 'OS2',
  VMS => 'VMS',
- epoc=> 'Epoc',
  NetWare => 'Win32', # Yes, File::Spec::Win32 works on NetWare.
  symbian => 'Win32', # Yes, File::Spec::Win32 works on symbian.
  dos => 'OS2',   # Yes, File::Spec::OS2 works on DJGPP.
diff --git a/dist/PathTools/lib/File/Spec/AmigaOS.pm 
b/dist/PathTools/lib/File/Spec/AmigaOS.pm
index a7def0bd9c..63a9050ee3 100644
--- a/dist/PathTools/lib/File/Spec/AmigaOS.pm
+++ b/dist/PathTools/lib/File/Spec/AmigaOS.pm
@@ -3,7 +3,7 @@ package File::Spec::AmigaOS;
 use strict;
 require File::Spec::Unix;
 
-our $VERSION = '3.70';
+our $VERSION = '3.71';
 $VERSION =~ tr/_//d;
 
 our @ISA = qw(File::Spec::Unix);
diff --git

[perl.git] branch zefram/dumb_match deleted. v5.27.6-50-gd6374f3d79

2017-12-17 Thread Zefram
In perl.git, the branch zefram/dumb_match has been deleted

<https://perl5.git.perl.org/perl.git/commitdiff/?hp=d6374f3d794e2a640258023e92e8d922409215ec>

   was  d6374f3d794e2a640258023e92e8d922409215ec

- Log -
d6374f3d794e2a640258023e92e8d922409215ec perldelta for more switch changes
---

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-317-gda4e040f42

2017-12-17 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/da4e040f42421764ef069371d77c008e6b801f45?hp=b2cd5cb1d8b3c8a7a7f033784d5134d2fbd8cad8>

- Log -
commit da4e040f42421764ef069371d77c008e6b801f45
Merge: b2cd5cb1d8 d6374f3d79
Author: Zefram <zef...@fysh.org>
Date:   Sun Dec 17 11:02:23 2017 +

merge branch zefram/dumb_match

---

Summary of changes:
 MANIFEST |3 +
 Porting/Maintainers.pl   |   16 +-
 cop.h|   24 +-
 cpan/autodie/lib/autodie/exception.pm|   19 +-
 cpan/autodie/lib/autodie/hints.pm|   19 +-
 cpan/autodie/t/exceptions.t  |   16 +-
 cpan/autodie/t/lib/Hints_pod_examples.pm |   16 +-
 cpan/experimental/t/basic.t  |   10 +-
 dump.c   |4 +-
 embed.fnc|   24 +-
 embed.h  |   20 +-
 ext/B/B.pm   |2 +-
 ext/B/t/f_map.t  |4 +-
 ext/B/t/optree_samples.t |   20 +-
 ext/Opcode/Opcode.pm |8 +-
 ext/Pod-Functions/Functions_pm.PL|2 +-
 ext/Pod-Functions/t/Functions.t  |2 +-
 ext/XS-APItest/t/fetch_pad_names.t   |5 +-
 ext/XS-APItest/t/grok.t  |   25 +-
 gv.c |5 +-
 inline.h |   47 +-
 keywords.c   |  181 ++--
 keywords.h   |  467 +
 lib/B/Deparse-core.t |6 +-
 lib/B/Deparse.pm |   63 +-
 lib/B/Deparse.t  |   54 +-
 lib/B/Op_private.pm  |   10 +-
 lib/feature.pm   |4 +-
 lib/overload.pm  |   31 +-
 lib/overload.t   |   12 +-
 op.c |  302 +-
 op.h |3 -
 opcode.h |  280 +++--
 opnames.h|  358 ---
 perl.h   |   11 +-
 perly.act|  838 +++
 perly.h  |   93 +-
 perly.tab| 1640 +++---
 perly.y  |   24 +-
 pod/perldelta.pod|   40 +
 pod/perldiag.pod |   80 +-
 pod/perlexperiment.pod   |8 +-
 pod/perlfunc.pod |   56 +-
 pod/perlintro.pod|4 +-
 pod/perlop.pod   |  298 +-
 pod/perlrun.pod  |1 -
 pod/perlsyn.pod  |  529 +++---
 pod/perltrap.pod |5 +-
 pp_ctl.c |  689 +
 pp_proto.h   |6 +-
 proto.h  |   64 +-
 regen/feature.pl |4 +-
 regen/keywords.pl|   10 +-
 regen/op_private |1 -
 regen/opcodes|   10 +-
 scope.c  |4 +-
 sv.c |7 +-
 t/lib/croak/pp_ctl   |   12 +-
 t/lib/feature/switch |  104 +-
 t/lib/warnings/9uninit   |7 -
 t/lib/warnings/op|2 +-
 t/lib/warnings/utf8  |5 +-
 t/op/coreamp.t   |   20 +-
 t/op/coresubs.t  |2 +-
 t/op/cproto.t|7 +-
 t/op/given.t |  238 +
 t/op/smartmatch.t|  661 ++--
 t/op/state.t |4 +-
 t/op/switch.t|  756 +-
 t/op/taint.t |   17 +-
 t/op/tie_fetch_count.t   |6 +-
 t/op/whereis.t   |   78 ++
 t/op/whereso.t   |  207 
 t/porting/customized.dat |5 +
 t/run/switches.t |9 +-
 toke.c   |   19 +-
 universal.c  |   34 +
 77 files changed, 3483 insertions(+), 5194 deletions(-)
 create mode 100644 t/op/given.t
 create mode 100644 t/op/whereis.t
 create mode 100644 t/op/whereso.t

diff --git a/MANIFEST b/MANIFEST
index 27ffee5299..5c3c4cae63 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -5669,6 +5669,7 @@ t/op/fork.t   See if fork works
 t/op/fre

[perl.git] branch blead updated. v5.27.6-278-g91ca80c3dd

2017-12-16 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/91ca80c3dda3ce14add7bd63f815556667be2fd4?hp=6f0a679aabc3cc3cdd954f1363ca917101fe38b9>

- Log -
commit 91ca80c3dda3ce14add7bd63f815556667be2fd4
Author: Zefram <zef...@fysh.org>
Date:   Sat Dec 16 22:46:33 2017 +

make dNOOP usable outside function in C++

Commit 7db66e12883f0832ca80164b723768b848187bda changed dNOOP in C++ from
an external function declaration (which was running into inconsistent
linkage) to a no-op statement.  The no-op statement is only valid where
statements are valid, i.e., inside a function, so this doesn't actually
work everywhere that a declaration is expected.

Switch dNOOP to be an incomplete struct declaration, regardless of
language.  This can certainly be used both inside and outside functions,
is valid to repeat, and does not have the linkage problem of a function
declaration.  It should also be as unlikely to attract an "unused"
warning as an external function declaration.

---

Summary of changes:
 perl.h | 11 +--
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/perl.h b/perl.h
index f5e284c0b2..162bc6b157 100644
--- a/perl.h
+++ b/perl.h
@@ -442,16 +442,7 @@
 #define CLANG_DIAG_RESTORE_STMT CLANG_DIAG_RESTORE NOOP
 
 #define NOOP /*EMPTY*/(void)0
-/* cea2e8a9dd23747f accidentally lost the comment originally from the first
-   check in of thread.h, explaining why we need dNOOP at all:  */
-/* Rats: if dTHR is just blank then the subsequent ";" throws an error */
-/* Declaring a *function*, instead of a variable, ensures that we don't rely
-   on being able to suppress "unused" warnings.  */
-#ifdef __cplusplus
-#define dNOOP (void)0
-#else
-#define dNOOP extern int Perl___notused(void)
-#endif
+#define dNOOP struct Perl___notused_struct
 
 #ifndef pTHX
 /* Don't bother defining tTHX ; using it outside

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-277-g6f0a679aab

2017-12-16 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/6f0a679aabc3cc3cdd954f1363ca917101fe38b9?hp=42034324c570544c22fe9a73865f20ab45e9d989>

- Log -
commit 6f0a679aabc3cc3cdd954f1363ca917101fe38b9
Author: Zefram <zef...@fysh.org>
Date:   Sat Dec 16 09:30:16 2017 +

typo fix in doc

---

Summary of changes:
 pod/perlfunc.pod | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 89e44dad12..6444509acc 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -1741,7 +1741,7 @@ exception objects.  See L for details about 
that.
 The stringified message should be non-empty, and should end in a newline,
 in order to fit in with the treatment of string exceptions.
 Also, because an exception object reference cannot be stringified
-without detroying it, Perl doesn't attempt to append location or other
+without destroying it, Perl doesn't attempt to append location or other
 information to a reference exception.  If you want location information
 with a complex exception object, you'll have to arrange to put the
 location information into the object yourself.

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-276-g42034324c5

2017-12-16 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/42034324c570544c22fe9a73865f20ab45e9d989?hp=7347ee5481c77d2fdb023e0a1c19943d039ecc86>

- Log -
commit 42034324c570544c22fe9a73865f20ab45e9d989
Author: Zefram <zef...@fysh.org>
Date:   Sat Dec 16 08:34:25 2017 +

show modern usage for {XS,Dyna}Loader

Fixes [perl #132247].

---

Summary of changes:
 dist/XSLoader/XSLoader_pm.PL| 23 +++
 ext/DynaLoader/DynaLoader_pm.PL |  4 ++--
 pod/perldelta.pod   | 12 
 3 files changed, 25 insertions(+), 14 deletions(-)

diff --git a/dist/XSLoader/XSLoader_pm.PL b/dist/XSLoader/XSLoader_pm.PL
index 0f8065fd3b..ec27350cb3 100644
--- a/dist/XSLoader/XSLoader_pm.PL
+++ b/dist/XSLoader/XSLoader_pm.PL
@@ -11,7 +11,7 @@ print OUT <<'EOT';
 
 package XSLoader;
 
-$VERSION = "0.28"; # remember to update version in POD!
+$VERSION = "0.29"; # remember to update version in POD!
 
 #use strict;
 
@@ -249,14 +249,14 @@ XSLoader - Dynamically load C libraries into Perl code
 
 =head1 VERSION
 
-Version 0.28
+Version 0.29
 
 =head1 SYNOPSIS
 
 package YourPackage;
 require XSLoader;
 
-XSLoader::load();
+XSLoader::load(__PACKAGE__, $VERSION);
 
 =head1 DESCRIPTION
 
@@ -277,7 +277,7 @@ A typical module using L<DynaLoader|DynaLoader> starts like 
this:
 
 our @ISA = qw( OnePackage OtherPackage DynaLoader );
 our $VERSION = '0.01';
-bootstrap YourPackage $VERSION;
+__PACKAGE__->bootstrap($VERSION);
 
 Change this to
 
@@ -286,7 +286,7 @@ Change this to
 
 our @ISA = qw( OnePackage OtherPackage );
 our $VERSION = '0.01';
-XSLoader::load 'YourPackage', $VERSION;
+XSLoader::load(__PACKAGE__, $VERSION);
 
 In other words: replace C by C, remove
 C from C<@ISA>, change C by C.  Do not
@@ -303,10 +303,9 @@ one can remove this reference to C<@ISA> together with the 
C<@ISA> assignment.
 
 If no C<$VERSION> was specified on the C line, the last line becomes
 
-XSLoader::load 'YourPackage';
+XSLoader::load(__PACKAGE__);
 
-If the call to C is from C, then that can be further
-simplified to
+in which case it can be further simplified to
 
 XSLoader::load();
 
@@ -323,12 +322,12 @@ boilerplate.
 our $VERSION = '0.01';
 eval {
require XSLoader;
-   XSLoader::load('YourPackage', $VERSION);
+   XSLoader::load(__PACKAGE__, $VERSION);
1;
 } or do {
require DynaLoader;
push @ISA, 'DynaLoader';
-   bootstrap YourPackage $VERSION;
+   __PACKAGE__->bootstrap($VERSION);
 };
 
 The parentheses about C<XSLoader::load()> arguments are needed since we 
replaced
@@ -394,7 +393,7 @@ boilerplate as
 
# Put Perl code used in the BOOT: section here
 
-   XSLoader::load 'YourPackage', $VERSION;
+   XSLoader::load(__PACKAGE__, $VERSION);
 }
 
 # Put Perl code making calls into XSUBs here
@@ -414,7 +413,7 @@ this:
 BEGIN {
@ISA = qw( OnePackage OtherPackage );
$VERSION = '0.01';
-   XSLoader::load 'YourPackage', $VERSION;
+   XSLoader::load(__PACKAGE__, $VERSION);
 }
 
 # Put Perl code used in onBOOT() function here; calls to XSUBs are
diff --git a/ext/DynaLoader/DynaLoader_pm.PL b/ext/DynaLoader/DynaLoader_pm.PL
index 8710d7feb8..41e6f94219 100644
--- a/ext/DynaLoader/DynaLoader_pm.PL
+++ b/ext/DynaLoader/DynaLoader_pm.PL
@@ -85,7 +85,7 @@ package DynaLoader;
 # tim.bu...@ig.co.uk, August 1994
 
 BEGIN {
-$VERSION = '1.44';
+$VERSION = '1.45';
 }
 
 EOT
@@ -564,7 +564,7 @@ DynaLoader - Dynamically load C libraries into Perl code
 package YourPackage;
 require DynaLoader;
 @ISA = qw(... DynaLoader ...);
-bootstrap YourPackage;
+__PACKAGE__->bootstrap;
 
 # optional method for 'global' loading
 sub dl_load_flags { 0x01 } 
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index fb5b7cfe94..8f3b6e3181 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -190,6 +190,18 @@ hashes tied to this module [perl #117449].
 It will now retry opening with an acceptable block size if asking gdbm
 to default the block size failed [perl #119623].
 
+=item *
+
+L has been upgraded from version 0.28 to 0.29.
+Its documentation now shows the use of C<__PACKAGE__>, and direct object
+syntax for example C usage [perl #132247].
+
+=item *
+
+L has been upgraded from version 1.44 to 1.45.
+Its documentation now shows the use of C<__PACKAGE__> and direct object
+syntax [perl #132247].
+
 =back
 
 =head2 Removed Modules and Pragmata

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-275-g7347ee5481

2017-12-15 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/7347ee5481c77d2fdb023e0a1c19943d039ecc86?hp=64def2aeaeb63f92dadc6dfa33486c1d7b311963>

- Log -
commit 7347ee5481c77d2fdb023e0a1c19943d039ecc86
Author: Zefram <zef...@fysh.org>
Date:   Sat Dec 16 07:12:48 2017 +

semicolon-friendly diagnostic control

New macros {GCC,CLANG}_DIAG_{IGNORE,RESTORE}_{DECL,STMT}, which take a
following semicolon.  It is necessary to use the _DECL or _STMT version
as appropriate to the context.  Fixes [perl #130726].

---

Summary of changes:
 dist/Time-HiRes/HiRes.pm  |  2 +-
 dist/Time-HiRes/HiRes.xs  | 25 ---
 dist/threads-shared/lib/threads/shared.pm |  4 ++--
 dist/threads-shared/shared.xs | 20 ++
 dist/threads/lib/threads.pm   |  4 ++--
 dist/threads/threads.xs   | 24 ++
 doio.c| 12 +--
 ext/POSIX/POSIX.xs|  4 ++--
 inline.h  | 24 +-
 locale.c  |  2 --
 perl.h| 34 ++-
 perlio.c  |  4 ++--
 pp_ctl.c  |  4 ++--
 pp_sys.c  | 16 +++
 regcomp.c |  4 ++--
 sv.c  |  8 
 taint.c   |  4 ++--
 toke.c| 12 +--
 util.c|  8 
 19 files changed, 112 insertions(+), 103 deletions(-)

diff --git a/dist/Time-HiRes/HiRes.pm b/dist/Time-HiRes/HiRes.pm
index 0ed28a17ff..8a2dab5cf5 100644
--- a/dist/Time-HiRes/HiRes.pm
+++ b/dist/Time-HiRes/HiRes.pm
@@ -49,7 +49,7 @@ our @EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday 
time tv_interval
 stat lstat utime
);
 
-our $VERSION = '1.9747';
+our $VERSION = '1.9748';
 our $XS_VERSION = $VERSION;
 $VERSION = eval $VERSION;
 
diff --git a/dist/Time-HiRes/HiRes.xs b/dist/Time-HiRes/HiRes.xs
index 6b0dba8e68..46a2254a6c 100644
--- a/dist/Time-HiRes/HiRes.xs
+++ b/dist/Time-HiRes/HiRes.xs
@@ -46,6 +46,15 @@ extern "C" {
 #define PERL_VERSION_GE(r,v,s) \
(PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s))
 
+#ifndef GCC_DIAG_IGNORE
+# define GCC_DIAG_IGNORE(x)
+# define GCC_DIAG_RESTORE
+#endif
+#ifndef GCC_DIAG_IGNORE_STMT
+# define GCC_DIAG_IGNORE_STMT(x) GCC_DIAG_IGNORE(x) NOOP
+# define GCC_DIAG_RESTORE_STMT GCC_DIAG_RESTORE NOOP
+#endif
+
 /* At least ppport.h 3.13 gets this wrong: one really cannot
  * have NVgf as anything else than "g" under Perl 5.6.x. */
 #if PERL_REVISION == 5 && PERL_VERSION == 6
@@ -1338,9 +1347,7 @@ setitimer(which, seconds, interval = 0)
 /* on some platforms the 1st arg to setitimer is an enum, which
  * causes -Wc++-compat to complain about passing an int instead
  */
-#ifdef GCC_DIAG_IGNORE
-GCC_DIAG_IGNORE(-Wc++-compat);
-#endif
+GCC_DIAG_IGNORE_STMT(-Wc++-compat);
if (setitimer(which, , ) == 0) {
  EXTEND(sp, 1);
  PUSHs(sv_2mortal(newSVnv(TV2NV(oldit.it_value;
@@ -1349,9 +1356,7 @@ setitimer(which, seconds, interval = 0)
PUSHs(sv_2mortal(newSVnv(TV2NV(oldit.it_interval;
  }
}
-#ifdef GCC_DIAG_RESTORE
-GCC_DIAG_RESTORE;
-#endif
+GCC_DIAG_RESTORE_STMT;
 
 void
 getitimer(which)
@@ -1362,9 +1367,7 @@ getitimer(which)
 /* on some platforms the 1st arg to getitimer is an enum, which
  * causes -Wc++-compat to complain about passing an int instead
  */
-#ifdef GCC_DIAG_IGNORE
-GCC_DIAG_IGNORE(-Wc++-compat);
-#endif
+GCC_DIAG_IGNORE_STMT(-Wc++-compat);
if (getitimer(which, ) == 0) {
  EXTEND(sp, 1);
  PUSHs(sv_2mortal(newSVnv(TV2NV(nowit.it_value;
@@ -1373,9 +1376,7 @@ getitimer(which)
PUSHs(sv_2mortal(newSVnv(TV2NV(nowit.it_interval;
  }
}
-#ifdef GCC_DIAG_RESTORE
-GCC_DIAG_RESTORE;
-#endif
+GCC_DIAG_RESTORE_STMT;
 
 #endif /* #if defined(HAS_GETITIMER) && defined(HAS_SETITIMER) */
 
diff --git a/dist/threads-shared/lib/threads/shared.pm 
b/dist/threads-shared/lib/threads/shared.pm
index 9be89f33f2..b9ba66e85b 100644
--- a/dist/threads-shared/lib/threads/shared.pm
+++ b/dist/threads-shared/lib/threads/shared.pm
@@ -7,7 +7,7 @@ use warnings;
 
 use Scalar::Util qw(reftype refaddr blessed);
 
-our $VERSION = '1.57'; # Please update the pod, too.
+our $VERSION = '1.58'; # Please update the pod, too.
 my $XS_VERSION = $VER

[perl.git] branch blead updated. v5.27.6-274-g64def2aeae

2017-12-15 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/64def2aeaeb63f92dadc6dfa33486c1d7b311963?hp=52e58e76455a7593547f41dc02823f4b5f83185c>

- Log -
commit 64def2aeaeb63f92dadc6dfa33486c1d7b311963
Author: Zefram <zef...@fysh.org>
Date:   Sat Dec 16 05:33:20 2017 +

perform system() arg processing before fork

A lot of things can happen when stringifying an argument list: side
effects, warnings, exceptions.  In the case of system(), these effects
should happen in the context of the parent process.  The stringification
can also depend on which process it happens in, as in the case of
$$, and in that case it should also happen in the parent process.
Therefore reduce the argument scalars to strings first thing in pp_system.
Fixes [perl #121105].

---

Summary of changes:
 pod/perldelta.pod |  7 +++
 pp_sys.c  | 16 ++--
 t/op/exec.t   | 15 ++-
 3 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index c3ed5083ea..fb5b7cfe94 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -596,6 +596,13 @@ or C method.  It is now treated like any other 
string C<1>.
 
 =item *
 
+C now reduces its arguments to strings in the parent process, so
+any effects of stringifying them (such as overload methods being called
+or warnings being emitted) are visible in the way the program expects.
+[perl #121105]
+
+=item *
+
 The C<readpipe()> built-in function now checks at compile time that
 it has only one parameter expression, and puts it in scalar context,
 thus ensuring that it doesn't corrupt the stack at runtime.  [perl #4574]
diff --git a/pp_sys.c b/pp_sys.c
index 337769b959..d94bf2fa20 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -4392,14 +4392,18 @@ PP(pp_system)
 int result;
 # endif
 
+while (++MARK <= SP) {
+   SV *origsv = *MARK;
+   STRLEN len;
+   char *pv;
+   pv = SvPV(origsv, len);
+   *MARK = newSVpvn_flags(pv, len,
+   (SvFLAGS(origsv) & SVf_UTF8) | SVs_TEMP);
+}
+MARK = ORIGMARK;
+
 if (TAINTING_get) {
TAINT_ENV();
-   while (++MARK <= SP) {
-   (void)SvPV_nolen_const(*MARK);  /* stringify for taint check */
-   if (TAINT_get)
-   break;
-   }
-   MARK = ORIGMARK;
TAINT_PROPER("system");
 }
 PERL_FLUSHALL_FOR_CHILD;
diff --git a/t/op/exec.t b/t/op/exec.t
index b55cbda09c..d696163f7c 100644
--- a/t/op/exec.t
+++ b/t/op/exec.t
@@ -36,7 +36,7 @@ $ENV{LANGUAGE} = 'C'; # Ditto in GNU.
 my $Is_VMS   = $^O eq 'VMS';
 my $Is_Win32 = $^O eq 'MSWin32';
 
-plan(tests => 38);
+plan(tests => 41);
 
 my $Perl = which_perl();
 
@@ -192,6 +192,19 @@ TODO: {
 or printf "# \$! eq %d, '%s'\n", $!, $!;
 }
 
+package CountRead {
+sub TIESCALAR { bless({ n => 0 }, $_[0]) }
+sub FETCH { ++$_[0]->{n} }
+}
+my $cr;
+tie $cr, "CountRead";
+is system($^X, "-e", "exit(\$ARGV[0] eq '1' ? 0 : 1)", $cr), 0,
+"system args have magic processed exactly once";
+is tied($cr)->{n}, 1, "system args have magic processed before fork";
+
+is system($^X, "-e", "exit(\$ARGV[0] eq \$ARGV[1] ? 0 : 1)", "$$", $$), 0,
+"system args have magic processed before fork";
+
 my $test = curr_test();
 exec $Perl, '-le', qq{${quote}print 'ok $test - exec PROG, LIST'${quote}};
 fail("This should never be reached if the exec() worked");

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-273-g52e58e7645

2017-12-15 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/52e58e76455a7593547f41dc02823f4b5f83185c?hp=d1500e115d7f380f58559a7db59d099856652b5b>

- Log -
commit 52e58e76455a7593547f41dc02823f4b5f83185c
Author: Zefram <zef...@fysh.org>
Date:   Sat Dec 16 04:47:08 2017 +

update and clarify "die" and "warn" doc

They didn't fully describe the handling of reference operands, and
there were other errors in their description of the treatment of the
operand list.  Fixes [perl #121372].

---

Summary of changes:
 pod/perldelta.pod |   6 +++
 pod/perlfunc.pod  | 127 ++
 2 files changed, 77 insertions(+), 56 deletions(-)

diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 99c823b8f8..c3ed5083ea 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -275,6 +275,12 @@ The documentation of C has been rewritten for clarity.
 The documentation of C now explains what syntactically qualifies
 as a version number for its module version checking feature.
 
+The documentation of C has been updated to reflect that since Perl
+5.14 it has treated complex exception objects in a manner equivalent
+to C.  [perl #121372]
+
+The documentation of C and C has been revised for clarity.
+
 =head3 L
 
 For each binary table or property, the documentation now includes which
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 3fcd437085..89e44dad12 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -1673,22 +1673,27 @@ X X X X X<$@> X
 
 =for Pod::Functions raise an exception or bail out
 
-L<C|/die LIST> raises an exception.  Inside an
-L<C|/eval EXPR> the error message is stuffed into
-L<C<$@>|perlvar/$@> and the L<C|/eval EXPR> is terminated with the
-undefined value.  If the exception is outside of all enclosing
-L<C|/eval EXPR>s, then the uncaught exception prints LIST to
-C and exits with a non-zero value.  If you need to exit the
-process with a specific exit code, see L<C|/exit EXPR>.
+L<C|/die LIST> raises an exception.  Inside an L<C|/eval EXPR>
+the exception is stuffed into L<C<$@>|perlvar/$@> and the L<C|/eval
+EXPR> is terminated with the undefined value.  If the exception is
+outside of all enclosing L<C|/eval EXPR>s, then the uncaught
+exception is printed to C and perl exits with an exit code
+indicating failure.  If you need to exit the process with a specific
+exit code, see L<C|/exit EXPR>.
 
 Equivalent examples:
 
 die "Can't cd to spool: $!\n" unless chdir '/usr/spool/news';
 chdir '/usr/spool/news' or die "Can't cd to spool: $!\n"
 
-If the last element of LIST does not end in a newline, the current
-script line number and input line number (if any) are also printed,
-and a newline is supplied.  Note that the "input line number" (also
+Most of the time, C is called with a string to use as the exception.
+You may either give a single non-reference operand to serve as the
+exception, or a list of two or more items, which will be stringified
+and concatenated to make the exception.
+
+If the string exception does not end in a newline, the current
+script line number and input line number (if any) and a newline
+are appended to it.  Note that the "input line number" (also
 known as "chunk") is subject to whatever notion of "line" happens to
 be currently in effect, and is also available as the special variable
 L<C<$.>|perlvar/$.>.  See L and L.
@@ -1705,49 +1710,45 @@ produce, respectively
 /etc/games is no good at canasta line 123.
 /etc/games is no good, stopped at canasta line 123.
 
-If the output is empty and L<C<$@>|perlvar/$@> already contains a value
-(typically from a previous L<C|/eval EXPR>) that value is reused after
+If LIST was empty or made an empty string, and L<C<$@>|perlvar/$@>
+already contains an exception value (typically from a previous
+L<C|/eval EXPR>), then that value is reused after
 appending C<"\t...propagated">.  This is useful for propagating exceptions:
 
 eval { ... };
 die unless $@ =~ /Expected exception/;
 
-If the output is empty and L<C<$@>|perlvar/$@> contains an object
+If LIST was empty or made an empty string,
+and L<C<$@>|perlvar/$@> contains an object
 reference that has a C method, that method will be called
 with additional file and line number parameters.  The return value
 replaces the value in L<C<$@>|perlvar/$@>;  i.e., as if
 C<< $@ = eval { $@->PROPAGATE(__FILE__, __LINE__) }; >> were called.
 
-If L<C<$@>|perlvar/$@> is empty, then the string C<"Died"> is used.
-
-I

[perl.git] branch blead updated. v5.27.6-272-gd1500e115d

2017-12-15 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/d1500e115d7f380f58559a7db59d099856652b5b?hp=80ad5f98d7229025d3f8149753f574d5b9fa64f6>

- Log -
commit d1500e115d7f380f58559a7db59d099856652b5b
Author: Zefram <zef...@fysh.org>
Date:   Sat Dec 16 02:17:08 2017 +

retry gdbm_open() upon block size error

It is reported that gdbm_open() with default block size can fail on
filesystems with a non-power-of-two block size.  In that event, retry
opening, forcing a power-of-two block size.  Fixes [perl #119623].

---

Summary of changes:
 ext/GDBM_File/GDBM_File.xs | 33 +
 pod/perldelta.pod  |  2 ++
 2 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/ext/GDBM_File/GDBM_File.xs b/ext/GDBM_File/GDBM_File.xs
index 33e08e20d1..7f91049116 100644
--- a/ext/GDBM_File/GDBM_File.xs
+++ b/ext/GDBM_File/GDBM_File.xs
@@ -23,8 +23,6 @@ typedef datum datum_key ;
 typedef datum datum_value ;
 typedef datum datum_key_copy;
 
-#define GDBM_BLOCKSIZE 0 /* gdbm defaults to stat blocksize */
-
 #if defined(GDBM_VERSION_MAJOR) && defined(GDBM_VERSION_MINOR) \
 && GDBM_VERSION_MAJOR > 1 || \
 (GDBM_VERSION_MAJOR == 1 && GDBM_VERSION_MINOR >= 9)
@@ -81,17 +79,28 @@ gdbm_TIEHASH(dbtype, name, read_write, mode)
char *  name
int read_write
int mode
+   PREINIT:
+   GDBM_FILE dbp;
CODE:
-   {
-   GDBM_FILE   dbp ;
-
-   RETVAL = NULL ;
-   if ((dbp =  gdbm_open(name, GDBM_BLOCKSIZE, read_write, mode,
- (FATALFUNC) croak_string))) {
-   RETVAL = (GDBM_File)safecalloc(1, sizeof(GDBM_File_type)) ;
-   RETVAL->dbp = dbp ;
-   }
-   
+   dbp = gdbm_open(name, 0, read_write, mode, (FATALFUNC)croak_string);
+   if (!dbp && gdbm_errno == GDBM_BLOCK_SIZE_ERROR) {
+   /*
+* By specifying a block size of 0 above, we asked gdbm to
+* default to the filesystem's block size.  That's usually the
+* right size to choose.  But some versions of gdbm require
+* a power-of-two block size, and some unusual filesystems
+* or devices have a non-power-of-two size that cause this
+* defaulting to fail.  In that case, force an acceptable
+* block size.
+*/
+   dbp = gdbm_open(name, 4096, read_write, mode,
+   (FATALFUNC)croak_string);
+   }
+   if (dbp) {
+   RETVAL = (GDBM_File)safecalloc(1, sizeof(GDBM_File_type));
+   RETVAL->dbp = dbp;
+   } else {
+   RETVAL = NULL;
}
OUTPUT:
  RETVAL
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 0dab15e879..99c823b8f8 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -187,6 +187,8 @@ core of its job.  [perl #110520]
 L has been upgraded from version 1.16 to 1.17.
 Its documentation now explains that C and C don't mix in
 hashes tied to this module [perl #117449].
+It will now retry opening with an acceptable block size if asking gdbm
+to default the block size failed [perl #119623].
 
 =back
 

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-271-g80ad5f98d7

2017-12-15 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/80ad5f98d7229025d3f8149753f574d5b9fa64f6?hp=3cd7355842a93fd631e01d9a1d60806b4cdbf5f0>

- Log -
commit 80ad5f98d7229025d3f8149753f574d5b9fa64f6
Author: Zefram <zef...@fysh.org>
Date:   Sat Dec 16 01:48:22 2017 +

add ticket number to perldelta entry

commit e1b825c19be2a160b0a3b633eb68e8d61887d21e
Author: Zefram <zef...@fysh.org>
Date:   Sat Dec 16 01:44:32 2017 +

widen size-type variables in pack/unpack

Most size-type variables in pp_pack.c were of type I32, with a
smattering of other types.  Use SSize_t in place of I32, and generally
use size_t-width variables as appropriate.  Fixes [perl #119367].

---

Summary of changes:
 embed.fnc | 10 +++---
 mathoms.c |  2 +-
 pod/perldelta.pod | 13 +++-
 pp_pack.c | 98 +++
 proto.h   | 10 +++---
 5 files changed, 72 insertions(+), 61 deletions(-)

diff --git a/embed.fnc b/embed.fnc
index 3387026948..4982544667 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -1789,10 +1789,10 @@ pn  |bool   |translate_substr_offsets|STRLEN 
curlen|IV pos1_iv \
 #if defined(UNLINK_ALL_VERSIONS)
 Ap |I32|unlnk  |NN const char* f
 #endif
-Apd|I32|unpack_str |NN const char *pat|NN const char *patend|NN 
const char *s \
+Apd|SSize_t|unpack_str |NN const char *pat|NN const char *patend|NN 
const char *s \
|NULLOK const char *strbeg|NN const char 
*strend|NULLOK char **new_s \
|I32 ocnt|U32 flags
-Apd|I32|unpackstring   |NN const char *pat|NN const char *patend|NN 
const char *s \
+Apd|SSize_t|unpackstring   |NN const char *pat|NN const char *patend|NN 
const char *s \
|NN const char *strend|U32 flags
 Ap |void   |unsharepvn |NULLOK const char* sv|I32 len|U32 hash
 : Used in gv.c, hv.c
@@ -2214,17 +2214,17 @@ pRxo|GV*|softref2xv |NN SV *const sv|NN 
const char *const what \
 #endif
 
 #if defined(PERL_IN_PP_PACK_C)
-s  |I32|unpack_rec |NN struct tempsym* symptr|NN const char *s \
+s  |SSize_t|unpack_rec |NN struct tempsym* symptr|NN const char *s \
|NN const char *strbeg|NN const char 
*strend|NULLOK const char **new_s
 s  |SV **  |pack_rec   |NN SV *cat|NN struct tempsym* symptr|NN SV 
**beglist|NN SV **endlist
 s  |SV*|mul128 |NN SV *sv|U8 m
-s  |I32|measure_struct |NN struct tempsym* symptr
+s  |SSize_t|measure_struct |NN struct tempsym* symptr
 s  |bool   |next_symbol|NN struct tempsym* symptr
 sR |SV*|is_an_int  |NN const char *s|STRLEN l
 s  |int|div128 |NN SV *pnum|NN bool *done
 s  |const char *|group_end |NN const char *patptr|NN const char *patend \
|char ender
-sR |const char *|get_num   |NN const char *patptr|NN I32 *lenptr
+sR |const char *|get_num   |NN const char *patptr|NN SSize_t *lenptr
 ns |bool   |need_utf8  |NN const char *pat|NN const char *patend
 ns |char   |first_symbol   |NN const char *pat|NN const char *patend
 sR |char * |sv_exp_grow|NN SV *sv|STRLEN needed
diff --git a/mathoms.c b/mathoms.c
index 66f2cc3768..295d8c4ea9 100644
--- a/mathoms.c
+++ b/mathoms.c
@@ -819,7 +819,7 @@ C instead.
 
 =cut */
 
-I32
+SSize_t
 Perl_unpack_str(pTHX_ const char *pat, const char *patend, const char *s,
const char *strbeg, const char *strend, char **new_s, I32 ocnt,
U32 flags)
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index f78c0ddfe0..0dab15e879 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -57,6 +57,12 @@ digit to appear after the radix point.  The digits are now 
restricted
 to those appropriate for the radix, as digits before the radix point
 always were.
 
+=head2 Return type of C<unpackstring()>
+
+The return types of the C API functions C<unpackstring()> and
+C<unpack_str()> have changed from C to C, in order to
+accommodate datasets of more than two billion items.
+
 =head1 Deprecations
 
 XXX Any deprecated features, syntax, modules etc. should be listed here.
@@ -180,7 +186,7 @@ core of its job.  [perl #110520]
 
 L has been upgraded from version 1.16 to 1.17.
 Its documentation now explains that C and C don't mix in
-hashes tied to this module.
+hashes tied to this module [perl #117449].
 
 =back
 
@@ -558,6 +564,11 @@ XXX
 
 =item *
 
+C and C can now handle repeat counts and lengths that
+exceed two billion.  [perl #119367]
+
+=item *
+
 Digits past the radix point in octal and binary floating point literals
 now have the correct weight on platforms where a floating point
 significand do

[perl.git] branch blead updated. v5.27.6-268-g3752113a31

2017-12-15 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/3752113a3158d060bec97da2512b1549afb5b4c7?hp=f3c710fe342032112ac92fc893f5ef050b4f7024>

- Log -
commit 3752113a3158d060bec97da2512b1549afb5b4c7
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 09:51:33 2017 +

document GDBM_File's delete vs each conflict

Fixes [perl #117449].

---

Summary of changes:
 ext/GDBM_File/GDBM_File.pm | 6 +-
 pod/perldelta.pod  | 6 ++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/ext/GDBM_File/GDBM_File.pm b/ext/GDBM_File/GDBM_File.pm
index fca06429cd..a33b8b59b1 100644
--- a/ext/GDBM_File/GDBM_File.pm
+++ b/ext/GDBM_File/GDBM_File.pm
@@ -20,6 +20,10 @@ module you should really have a copy of the gdbm manualpage 
at hand.
 Most of the libgdbm.a functions are available through the GDBM_File
 interface.
 
+Unlike Perl's built-in hashes, it is not safe to C the current
+item from a GDBM_File tied hash while iterating over it with C.
+This is a limitation of the gdbm library.
+
 =head1 AVAILABILITY
 
 gdbm is available from any GNU archive.  The master site is
@@ -69,7 +73,7 @@ require XSLoader;
 );
 
 # This module isn't dual life, so no need for dev version numbers.
-$VERSION = '1.16';
+$VERSION = '1.17';
 
 XSLoader::load();
 
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index d6e9437a3d..f78c0ddfe0 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -176,6 +176,12 @@ default from a "NAME" section in the POD document, as it 
used to be
 before the module was rewritten to use L to do the
 core of its job.  [perl #110520]
 
+=item *
+
+L has been upgraded from version 1.16 to 1.17.
+Its documentation now explains that C and C don't mix in
+hashes tied to this module.
+
 =back
 
 =head2 Removed Modules and Pragmata

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-267-gf3c710fe34

2017-12-14 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/f3c710fe342032112ac92fc893f5ef050b4f7024?hp=bddfdacf0b41874346e0cd549746330ac8ece214>

- Log -
commit f3c710fe342032112ac92fc893f5ef050b4f7024
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 07:00:11 2017 +

rewrite "ref" documentation for clarity

---

Summary of changes:
 pod/perldelta.pod |  2 ++
 pod/perlfunc.pod  | 93 ---
 2 files changed, 42 insertions(+), 53 deletions(-)

diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 4964913fd1..d6e9437a3d 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -256,6 +256,8 @@ The description of C<@INC> hooks in the documentation for 
C
 has been corrected to say that filter subroutines receive a useless
 first argument.  [perl #115754]
 
+The documentation of C has been rewritten for clarity.
+
 The documentation of C now explains what syntactically qualifies
 as a version number for its module version checking feature.
 
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 342e942c60..78773e944b 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -6288,59 +6288,46 @@ X X
 
 =for Pod::Functions find out the type of thing being referenced
 
-Returns a non-empty string if EXPR is a reference, the empty
-string otherwise.  If EXPR is not specified, L<C<$_>|perlvar/$_> will be
-used.  The value returned depends on the type of thing the reference is
-a reference to.
-
-Builtin types include:
-
-SCALAR
-ARRAY
-HASH
-CODE
-REF
-GLOB
-LVALUE
-FORMAT
-IO
-VSTRING
-Regexp
-
-You can think of L<C|/ref EXPR> as a C operator.
-
-if (ref($r) eq "HASH") {
-print "r is a reference to a hash.\n";
-}
-unless (ref($r)) {
-print "r is not a reference at all.\n";
-}
-
-The return value C indicates a reference to an lvalue that is not
-a variable.  You get this from taking the reference of function calls like
-L<C|/pos SCALAR> or
-L<C|/substr EXPR,OFFSET,LENGTH,REPLACEMENT>.  C is
-returned if the reference points to a
-L.
-
-The result C indicates that the argument is a regular expression
-resulting from L<C<qrEE>|/qrESTRINGE>.
-
-If the referenced object has been blessed into a package, then that package
-name is returned instead.  But don't use that, as it's now considered
-"bad practice".  For one reason, an object could be using a class called
-C or C, or even C.  Also, L<C|/ref EXPR> doesn't
-take into account subclasses, like
-L<C|UNIVERSAL/C<< $obj->isa( TYPE ) >>> does.
-
-Instead, use L<C|Scalar::Util/blessed> (in the L
-module) for boolean checks, L<C|UNIVERSAL/C<< $obj->isa( TYPE ) >>>
-for specific class checks and L<C|Scalar::Util/reftype> (also
-from L) for type checks.  (See L for details and
-a L<C|Scalar::Util/blessed>/L<C|UNIVERSAL/C<< $obj->isa( TYPE ) 
>>>
-example.)
-
-See also L.
+Examines the value of EXPR, expecting it to be a reference, and returns
+a string giving information about the reference and the type of referent.
+If EXPR is not specified, L<C<$_>|perlvar/$_> will be used.
+
+If the operand is not a reference, then the empty string will be returned.
+An empty string will only be returned in this situation.  C is often
+useful to just test whether a value is a reference, which can be done
+by comparing the result to the empty string.  It is a common mistake
+to use the result of C directly as a truth value: this goes wrong
+because C<0> (which is false) can be returned for a reference.
+
+If the operand is a reference to a blessed object, then the name of
+the class into which the referent is blessed will be returned.  C
+doesn't care what the physical type of the referent is; blessing takes
+precedence over such concerns.  Beware that exact comparison of C
+results against a class name doesn't perform a class membership test:
+a class's members also include objects blessed into subclasses, for
+which C will return the name of the subclass.  Also beware that
+class names can clash with the built-in type names (described below).
+
+If the operand is a reference to an unblessed object, then the return
+value indicates the type of object.  If the unblessed referent is not
+a scalar, then the return value will be one of the strings C,
+C, C, C, or C, indicating only which kind of
+object it is.  If the unblessed referent is a scalar, then the return
+value will be one of the strings C, C, C, C,
+C, or C, depending on the kind of value the scalar
+currently has.  Beware that these built-in type names can also be used as
+class names, so C returning one of these

[perl.git] branch blead updated. v5.27.6-266-gbddfdacf0b

2017-12-14 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/bddfdacf0b41874346e0cd549746330ac8ece214?hp=222b5ca9896e49f76fcbb1f6e1e73b312570868c>

- Log -
commit bddfdacf0b41874346e0cd549746330ac8ece214
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 05:12:32 2017 +

clean up directories of split pod files

Fixes [perl #114316].

---

Summary of changes:
 installhtml | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/installhtml b/installhtml
index 62e92fc806..9f6ef7e60a 100644
--- a/installhtml
+++ b/installhtml
@@ -4,6 +4,7 @@
 
 use strict;
 use Config;# for config options in the makefile
+use File::Path qw(remove_tree);
 use File::Spec::Functions qw(rel2abs no_upwards);
 use Getopt::Long;  # for command-line parsing
 use Cwd;
@@ -258,6 +259,8 @@ foreach my $dir (@splithead) {
 close(H);
 }
 
+remove_tree(@splitdirs, {safe=>1});
+
 ##
 
 
@@ -378,10 +381,9 @@ sub split_on_item {
 
# split the pod
push(@$splitdirs, "$podroot/$dirname");
-   if (! -d "$podroot/$dirname") {
-   mkdir("$podroot/$dirname", 0755) ||
+   -d "$podroot/$dirname" and remove_tree("$podroot/$dirname", {safe=>1});
+   mkdir("$podroot/$dirname", 0755) ||
die "$0: error creating directory $podroot/$dirname: $!\n";
-   }
chdir("$podroot/$dirname") ||
die "$0: error changing to directory $podroot/$dirname: $!\n";
die "$splitter not found. Use '-splitpod dir' option.\n"
@@ -437,9 +439,9 @@ sub splitpod {
 my $dir = $pod;
 $dir =~ s/\.pod//g;
 push(@$splitdirs, "$poddir/$dir");
+-d "$poddir/$dir" and remove_tree("$poddir/$dir", {safe=>1});
 mkdir("$poddir/$dir", 0755) ||
-   die "$0: could not create directory $poddir/$dir: $!\n"
-   unless -d "$poddir/$dir";
+   die "$0: could not create directory $poddir/$dir: $!\n";
 
 $poddata[0] =~ /^\s*=head[1-6]\s+(.*)/;
 $section= "";

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-265-g222b5ca989

2017-12-14 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/222b5ca9896e49f76fcbb1f6e1e73b312570868c?hp=282fc0b3cc2439f69587d980b62bef7f5d5bdfef>

- Log -
commit 222b5ca9896e49f76fcbb1f6e1e73b312570868c
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 02:14:25 2017 +

perldelta 282fc0b3cc2439f69587d980b62bef7f5d5bdfef

commit a8b6459c07dbcbb1811d80c8d22de38914a8cce9
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 02:12:42 2017 +

perldelta e135ff695231a81e2a70a739e8d813525432fd4d

commit 30f9405e6b511a6cf9b6a87df6fe03d755268786
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 02:11:13 2017 +

perldelta 47836a13cc4c999c9b3589c6797d6769b52c37fd

commit 9fca523d0f0e607b4f7f397609258a187abe47df
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 02:09:15 2017 +

perldelta 3d033384b2016a58c3eed89524dc658660c759ce

commit a8d9a21987530b34fc10e78fb0405dc27b93db1b
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 02:06:54 2017 +

perldelta 0bd1c35ee47dab181543ba366fe021122c591f65

commit c3fac04c37f589c91d189f30951d93f35d17c513
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 02:03:33 2017 +

perldelta 38e30ca7507a601c2d84596bc51d88c0f3c516b4

commit 415e5995e519861b51ab51a35ba957794d29a009
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 02:00:05 2017 +

perldelta addf67e13a08f45d3bb4c245c821b1ef2767c5a5

commit 364b8cf9b4fc5c83097a45783243e57a1440aadf
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 01:58:26 2017 +

perldelta 27d3197f2b90b3534ea74a96fc7e37200baeb9b7

commit d2f4250c0a968caee51acc82f461efb061a3d2e9
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 01:55:17 2017 +

perldelta d5407247046f2f01c1492998b32b3b148445febe

commit d679c20fded9b40ee1ab7917ec766709408c57ad
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 01:53:56 2017 +

perldelta 16ada235c332e017667585e1a5a00ce43a31c529

commit 9a40fcb68413c7a6091696885a6f6b34ec8bdf97
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 01:50:55 2017 +

perldelta 397baf232086e0a9ad6f881a9614d3dbaea853fc

commit e6b4f2eb74b005fb564767d3f6497c6eb0322118
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 01:48:41 2017 +

perldelta 0165f7b01e9c43629d0c6f4b5eb2e672abeda51a

commit 07d61e7e1a6375a30188e89714ba3adc2842792f
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 01:46:30 2017 +

perldelta dd9e86b4501b7c8aeba1f5ebda9f8907747c443f

commit 4914bebe01919e21e1637fffd9f435aff8323df3
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 01:44:39 2017 +

perldelta 9b91093d3e74d13a6e4f67269a587f4ab397998a

commit 9deb4e0b2a487101c60094bc5ae0b48b95a8b3d9
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 01:43:34 2017 +

perldelta b5145c7d479fcfcb104fc6d3d89b4d757ca3cd15

commit 4dab62e37e2cde8fcb4e073d20766a3049909216
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 01:39:19 2017 +

perldelta 0301e899536a22752f40481d8a1d141b7a7dda82

commit 8f46363a472d5148c5802fbdd14a98b120decc9d
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 01:32:39 2017 +

perldelta 6c4f4eb174d1e2e9f874786123a699d11ae741f9

commit 8af6a5dc9c0d8083b84f5b4ab8e673d7f1735cc0
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 01:30:38 2017 +

perldelta 1af9149031d9f5d2d43b6df59b628a0f2c1041f6

commit 66d3c925df6e7a4f30a908b58d3b386869cfaeb4
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 01:29:23 2017 +

perldelta bff3de19b083d33895fc03f7d7d092e5830547a5

commit b6108eb9fc6a788aa0f80061c8df0d567b49c286
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 01:27:12 2017 +

perldelta b3893bfa90e8810497e2f81458a5a46db611cadf

commit cab9f0b06f11457cc6401462694a4b7cb5443b70
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 01:24:36 2017 +

perldelta 0c9c439d08a65206d442724bcd9fb29fa5a7f937

commit 153970073e9454e80a59b7a5a3a3f139f29054d2
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 01:20:03 2017 +

perldelta 58be57636a42d6c6fd404c48c4e1cb87870182df

commit 53fff74789b1c02c7f9308465f592da16d6dd11f
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 01:16:14 2017 +

perldelta 7c6e7cf06853eef1d1b271077c402c5f8655fbe6

commit 998753fedd3024a3c9439b57aba2cbd02ad69ab2
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 01:14:01 2017 +

perldelta 38a3df78b8fbbdf02988dd5fe691c23a8041334f

commit b32ad89ce82eeb2ccde7555990f1ad39ce212379
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 01:11:47 2017 +

perldelta 557714184de18964b954b2c00fa13127fd3f216a

commit b782ddf47a7fe9551f77f83a5a2a091b2c9b9cfd
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 15 01:09:48 2017 +

perldelta 3c0dbbbaeb55e3

[perl.git] branch blead updated. v5.27.6-231-g282fc0b3cc

2017-12-14 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/282fc0b3cc2439f69587d980b62bef7f5d5bdfef?hp=e135ff695231a81e2a70a739e8d813525432fd4d>

- Log -
commit 282fc0b3cc2439f69587d980b62bef7f5d5bdfef
Author: Zefram <zef...@fysh.org>
Date:   Wed Dec 6 21:27:15 2017 +

make exec keep its argument list more reliably

Bits of exec code were putting the constructed commands into globals
PL_Argv and PL_Cmd, which could then be clobbered by reentrancy.
These are only global in order to manage their freeing, but that's
better managed by using the scope stack.  So replace them with automatic
variables, with ENTER/SAVEFREEPV/LEAVE to free the memory.  Also copy
the strings acquired from SVs, to avoid magic clobbering the buffers of
SVs already read.  Fixes [perl #129888].

---

Summary of changes:
 amigaos4/amigaio.c |  66 +---
 cygwin/cygwin.c|  28 +-
 djgpp/djgpp.c  |  36 +++---
 doio.c |  77 ++---
 embed.fnc  |   1 -
 embed.h|   1 -
 embedvar.h |   2 -
 intrpvar.h |   2 -
 os2/os2.c  | 109 ++---
 pp_sys.c   |   2 -
 proto.h|   1 -
 sv.c   |   2 -
 util.c |   2 -
 vms/vms.c  |  23 +--
 14 files changed, 186 insertions(+), 166 deletions(-)

diff --git a/amigaos4/amigaio.c b/amigaos4/amigaio.c
index b471220260..edc237a033 100644
--- a/amigaos4/amigaio.c
+++ b/amigaos4/amigaio.c
@@ -646,7 +646,7 @@ static void S_exec_failed(pTHX_ const char *cmd, int fd, 
int do_report)
 static I32 S_do_amigaos_exec3(pTHX_ const char *incmd, int fd, int do_report)
 {
dVAR;
-   const char **a;
+   const char **argv, **a;
char *s;
char *buf;
char *cmd;
@@ -656,7 +656,9 @@ static I32 S_do_amigaos_exec3(pTHX_ const char *incmd, int 
fd, int do_report)
 
PERL_ARGS_ASSERT_DO_EXEC3;
 
+   ENTER;
Newx(buf, cmdlen, char);
+   SAVEFREEPV(buf);
cmd = buf;
memcpy(cmd, incmd, cmdlen);
 
@@ -709,15 +711,16 @@ doshell:
PERL_FPU_POST_EXEC
S_exec_failed(aTHX_ PL_sh_path, fd, do_report);
amigaos_post_exec(fd, do_report);
-   Safefree(buf);
-   return result;
+   goto leave;
}
}
 
-   Newx(PL_Argv, (s - cmd) / 2 + 2, const char *);
-   PL_Cmd = savepvn(cmd, s - cmd);
-   a = PL_Argv;
-   for (s = PL_Cmd; *s;)
+   Newx(argv, (s - cmd) / 2 + 2, const char *);
+   SAVEFREEPV(argv);
+   cmd = savepvn(cmd, s - cmd);
+   SAVEFREEPV(cmd);
+   a = argv;
+   for (s = cmd; *s;)
{
while (isSPACE(*s))
s++;
@@ -729,22 +732,18 @@ doshell:
*s++ = '\0';
}
*a = NULL;
-   if (PL_Argv[0])
+   if (argv[0])
{
PERL_FPU_PRE_EXEC
-   result = myexecvp(FALSE, PL_Argv[0], EXEC_ARGV_CAST(PL_Argv));
+   result = myexecvp(FALSE, argv[0], EXEC_ARGV_CAST(argv));
PERL_FPU_POST_EXEC
-   if (errno == ENOEXEC)
-   {
-   /* for system V NIH syndrome */
-   do_execfree();
+   if (errno == ENOEXEC) /* for system V NIH syndrome */
goto doshell;
-   }
-   S_exec_failed(aTHX_ PL_Argv[0], fd, do_report);
+   S_exec_failed(aTHX_ argv[0], fd, do_report);
amigaos_post_exec(fd, do_report);
}
-   do_execfree();
-   Safefree(buf);
+leave:
+   LEAVE;
return result;
 }
 
@@ -754,42 +753,47 @@ I32 S_do_amigaos_aexec5(
dVAR;
I32 result = -1;
PERL_ARGS_ASSERT_DO_AEXEC5;
+   ENTER;
if (sp > mark)
{
-   const char **a;
+   const char **argv, **a;
const char *tmps = NULL;
-   Newx(PL_Argv, sp - mark + 1, const char *);
-   a = PL_Argv;
+   Newx(argv, sp - mark + 1, const char *);
+   SAVEFREEPV(argv);
+   a = argv;
 
while (++mark <= sp)
{
-   if (*mark)
-   *a++ = SvPV_nolen_const(*mark);
-   else
+   if (*mark) {
+   char *arg = savepv(SvPV_nolen_const(*mark));
+   SAVEFREEPV(arg);
+   *a++ = arg;
+   

[perl.git] branch smoke-me/zefram/exec_args deleted. v5.27.6-150-g1cd4fed954

2017-12-14 Thread Zefram
In perl.git, the branch smoke-me/zefram/exec_args has been deleted

<https://perl5.git.perl.org/perl.git/commitdiff/?hp=1cd4fed954752f6b49e30758b5ab8057337b5674>

   was  1cd4fed954752f6b49e30758b5ab8057337b5674

- Log -
1cd4fed954752f6b49e30758b5ab8057337b5674 make exec keep its argument list more 
reliably
---

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-230-ge135ff6952

2017-12-14 Thread Zefram
In perl.git, the branch blead has been updated



- Log -
commit e135ff695231a81e2a70a739e8d813525432fd4d
Author: Marco Fontani 
Date:   Wed Dec 13 11:11:44 2017 +0100

refer to perldiag from perlfunc

Rather than duplicating information as to which keyword, function, or
operator generates which warning, point the reader to the proper place
to read about which warnings Perl generates in which scenario, which are
well described in the POD for "warnings".  [perl #116080]

---

Summary of changes:
 pod/perlfunc.pod | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 5043d82214..342e942c60 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -104,7 +104,8 @@ X
 Here are Perl's functions (including things that look like
 functions, like some keywords and named operators)
 arranged by category.  Some functions appear in more
-than one place.
+than one place.  Any warnings, including those produced by
++keywords, are described in L and L.
 
 =over 4
 

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-229-g47836a13cc

2017-12-14 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/47836a13cc4c999c9b3589c6797d6769b52c37fd?hp=b2ad2123be0005e33a47e297d0d9bdc640f635ea>

- Log -
commit 47836a13cc4c999c9b3589c6797d6769b52c37fd
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 8 19:23:29 2017 +

don't lose mark when pp_reverse extends stack

Nullary reverse needs to extend the stack to push its result scalar.
It was actually extending the stack, but doing so invalidated MARK,
which it relied upon to place the stack pointer afterwards.  Upon stack
reallocation it was therefore leaving the stack pointer pointing to the
freed stack memory.  Reformulate stack manipulation to not rely on MARK
after extending.  Fixes [perl #132544].

---

Summary of changes:
 pp.c   | 13 +++--
 t/op/reverse.t |  7 ++-
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/pp.c b/pp.c
index 3ef23cae59..ae6d9c94d1 100644
--- a/pp.c
+++ b/pp.c
@@ -5613,13 +5613,16 @@ PP(pp_reverse)
STRLEN len;
 
SvUTF8_off(TARG);   /* decontaminate */
-   if (SP - MARK > 1)
+   if (SP - MARK > 1) {
do_join(TARG, _sv_no, MARK, SP);
-   else if (SP > MARK)
+   SP = MARK + 1;
+   SETs(TARG);
+   } else if (SP > MARK) {
sv_setsv(TARG, *SP);
-else {
+   SETs(TARG);
+} else {
sv_setsv(TARG, DEFSV);
-EXTEND(SP, 1);
+   XPUSHs(TARG);
}
 
up = SvPV_force(TARG, len);
@@ -5657,8 +5660,6 @@ PP(pp_reverse)
}
(void)SvPOK_only_UTF8(TARG);
}
-   SP = MARK + 1;
-   SETTARG;
 }
 RETURN;
 }
diff --git a/t/op/reverse.t b/t/op/reverse.t
index fd06560fdf..a7d3178211 100644
--- a/t/op/reverse.t
+++ b/t/op/reverse.t
@@ -6,7 +6,7 @@ BEGIN {
 set_up_inc('../lib');
 }
 
-plan tests => 25;
+plan tests => 26;
 
 is(reverse("abc"), "cba", 'simple reverse');
 
@@ -105,3 +105,8 @@ SKIP: {
 ok defined $a[-1] && ${$a[-1]} eq '1', "in-place reverse strengthens weak 
reference";
 ok defined $a[2] && ${$a[2]} eq '3', "in-place reverse strengthens weak 
reference in the middle";
 }
+
+# [perl #132544] stack pointer used to go wild when nullary reverse
+# required extending the stack
+for(0..1000){()=(0..$_,scalar reverse )}
+pass "extending the stack without crashing";

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-227-g3d033384b2

2017-12-13 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/3d033384b2016a58c3eed89524dc658660c759ce?hp=9b568b537ddf7c0495ef59f31183cfb270c398bc>

- Log -
commit 3d033384b2016a58c3eed89524dc658660c759ce
Author: Zefram <zef...@fysh.org>
Date:   Thu Dec 14 04:23:58 2017 +

warn on $a.$b.$c in void context

$a.$b.$c gets transformed early on to execute as ($a.$b).=$c, which didn't
warn about void context becuase .= looks like a useful side effect.
Happily, the recently-added OPpCONCAT_NESTED flag identifies that this
has happened.  Make scalarvoid() pay attention to this flag when a concat
op is put into void context.  Fixes [perl #6997]

---

Summary of changes:
 op.c  | 5 +
 t/lib/warnings/op | 9 +
 2 files changed, 14 insertions(+)

diff --git a/op.c b/op.c
index 74de752405..402c6f1610 100644
--- a/op.c
+++ b/op.c
@@ -1949,6 +1949,11 @@ Perl_scalarvoid(pTHX_ OP *arg)
 if (o->op_type == OP_REPEAT)
 scalar(cBINOPo->op_first);
 goto func_ops;
+   case OP_CONCAT:
+if ((o->op_flags & OPf_STACKED) &&
+   !(o->op_private & OPpCONCAT_NESTED))
+break;
+   goto func_ops;
 case OP_SUBSTR:
 if (o->op_private == 4)
 break;
diff --git a/t/lib/warnings/op b/t/lib/warnings/op
index ead60adde1..b28c4e9166 100644
--- a/t/lib/warnings/op
+++ b/t/lib/warnings/op
@@ -2065,3 +2065,12 @@ use warnings;
 $_="3.14159";
 tr/0-9/\x{6F0}-\x{6F9}/;
 EXPECT
+
+# Useless use of concatenation should appear for any number of args
+use warnings;
+($a, $b, $c) = (42)x3;
+$a.$b;
+$a.$b.$c;
+EXPECT
+Useless use of concatenation (.) or string in void context at - line 4.
+Useless use of concatenation (.) or string in void context at - line 5.

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-222-g30041f3118

2017-12-13 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/30041f3118304040b51b485248557e17239c01bf?hp=59eb8be1443b97df4c7886794cd12918a376321a>

- Log -
commit 30041f3118304040b51b485248557e17239c01bf
Author: Zefram <zef...@fysh.org>
Date:   Thu Dec 14 02:37:03 2017 +

add preload to .gitignore

commit 0bd1c35ee47dab181543ba366fe021122c591f65
Author: Zefram <zef...@fysh.org>
Date:   Thu Dec 14 02:27:28 2017 +

fix links in generated HTML documentation

Invoke installhtml in the right way for it to generate relative links.
Fix installhtml's code for creating relative links in the index for
split documents.  Update Pod::Html's section name transformer to
match the actual output seen via Pod::Simple::XHTML.  Incidentally
update split-on-head code for the new style of HTML generated by
Pod::Simple::XHTML.  Fixes [perl #110056].

---

Summary of changes:
 .gitignore   |  1 +
 Makefile.SH  |  1 -
 ext/Pod-Html/lib/Pod/Html.pm | 19 +++
 ext/Pod-Html/t/anchorify.t   | 24 
 installhtml  | 14 +++---
 5 files changed, 27 insertions(+), 32 deletions(-)

diff --git a/.gitignore b/.gitignore
index 499a1cb272..7f3b7b1933 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,6 +34,7 @@ bug*.pl
 /perlmain.c
 /perlmini.c
 /pod/Makefile
+/preload
 /runtests
 /writemain
 /x2p/Makefile
diff --git a/Makefile.SH b/Makefile.SH
index 7ddb23ed2d..8569955e57 100755
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -1204,7 +1204,6 @@ install.html: all installhtml
${LOCAL_PERL} installhtml   \\
   --podroot=. --podpath=. --recurse  \\
   --htmldir=\$(privlib)/html   \\
-  --htmlroot=\$(privlib)/html  \\
   --splithead=pod/perlipc \\
   --splititem=pod/perlfunc\\
   
--ignore=Porting/Maintainers.pm,Porting/pumpkin.pod,Porting/repository.pod \\
diff --git a/ext/Pod-Html/lib/Pod/Html.pm b/ext/Pod-Html/lib/Pod/Html.pm
index 8f7999b835..4927a7c961 100644
--- a/ext/Pod-Html/lib/Pod/Html.pm
+++ b/ext/Pod-Html/lib/Pod/Html.pm
@@ -5,7 +5,7 @@ require Exporter;
 our $VERSION = 1.23;
 our @ISA = qw(Exporter);
 our @EXPORT = qw(pod2html htmlify);
-our @EXPORT_OK = qw(anchorify);
+our @EXPORT_OK = qw(anchorify relativize_url);
 
 use Carp;
 use Config;
@@ -661,19 +661,12 @@ sub html_escape {
 
 #
 # htmlify - converts a pod section specification to a suitable section
-# specification for HTML. Note that we keep spaces and special characters
-# except ", ? (Netscape problem) and the hyphen (writer's problem...).
+# specification for HTML.  We adopt the mechanism used by the formatter
+# that we use.
 #
 sub htmlify {
 my( $heading) = @_;
-$heading =~ s/(\s+)/ /g;
-$heading =~ s/\s+\Z//;
-$heading =~ s/\A\s+//;
-# The hyphen is a disgrace to the English language.
-# $heading =~ s/[-"?]//g;
-$heading =~ s/["?]//g;
-$heading = lc( $heading );
-return $heading;
+return Pod::Simple::XHTML->can("idify")->(undef, $heading, 1);
 }
 
 #
@@ -801,7 +794,7 @@ sub resolve_pod_page_link {
 # then $self->htmlroot eq '' (by definition of htmlfileurl) so
 # $self->htmldir needs to be prepended to link to get the absolute path
 # that will be relativized
-$url = relativize_url(
+$url = Pod::Html::relativize_url(
 File::Spec::Unix->catdir(Pod::Html::_unixify($self->htmldir), 
$url),
 $self->htmlfileurl # already unixified
 );
@@ -810,6 +803,8 @@ sub resolve_pod_page_link {
 return $url . ".html$section";
 }
 
+package Pod::Html;
+
 #
 # relativize_url - convert an absolute URL to one relative to a base URL.
 # Assumes both end in a filename.
diff --git a/ext/Pod-Html/t/anchorify.t b/ext/Pod-Html/t/anchorify.t
index d7b180818f..0677f9ed30 100644
--- a/ext/Pod-Html/t/anchorify.t
+++ b/ext/Pod-Html/t/anchorify.t
@@ -23,18 +23,18 @@ foreach $i (0..$#poddata) {
 $heads{anchorify($1)} = 1 if $poddata[$i] =~ /=head[1-6]\s+(.*)/;
 }
 my %expected = map { $_ => 1 } qw(
-name
-description
-subroutine
-error
-method
-has_a_wordspace
-hastrailingwordspace
-hasleadingwordspace
-has_extra_internalwordspace
-hasquotes
-hasquestionmark
-has_hyphen_and_space
+NAME
+DESCRIPTION
+Subroutine
+Error
+Method
+Has_A_Wordspace
+HasTrailingWordspace
+HasLeadingWordspace
+Has_Extra_InternalWordspace
+Has_Quotes
+Has_QuestionMark
+Has_Hyphen_And_Space
 );
 is_deeply(
 \%heads,
diff --git a/installhtml b/installhtml
index 1b724c0c41..62e92fc806 100644
--- a/installhtml
+++ b/installhtml
@@ -7,7 +7,7 @@ use Config; # for config options in the makefile
 use File::

[perl.git] branch blead updated. v5.27.6-218-g38e30ca750

2017-12-13 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/38e30ca7507a601c2d84596bc51d88c0f3c516b4?hp=7d5ed5d0f107110d6b559148f4f68a8dd26aee46>

- Log -
commit 38e30ca7507a601c2d84596bc51d88c0f3c516b4
Author: Zefram <zef...@fysh.org>
Date:   Wed Dec 13 22:59:28 2017 +

automatic titling in Pod::Html

Automatic extraction of a title from the content was lost with the
switch to using Pod::Simple::XHTML for rendering.  It would be tricky
to add in Pod::Simple::XHTML, or anything else integrated into that
parser, because the stream-oriented approach plays poorly with any kind
of lookahead.  Instead go to a two-stage conversion, parsing the input
to tree form using Pod::Simple::SimpleTree and later feeding the tree
to the stream-oriented Pod::Simple::XHTML for output.  Between the two
stages, extract a default title from the tree, in time to use it when
setting options for Pod::Simple::XHTML.  Fixes [perl #110520].

---

Summary of changes:
 ext/Pod-Html/lib/Pod/Html.pm | 85 +++-
 ext/Pod-Html/t/crossref.t|  2 +-
 ext/Pod-Html/t/crossref2.t   |  2 +-
 ext/Pod-Html/t/crossref3.t   |  2 +-
 ext/Pod-Html/t/htmldir1.t|  2 +-
 ext/Pod-Html/t/htmldir2.t|  2 +-
 ext/Pod-Html/t/htmldir3.t|  2 +-
 ext/Pod-Html/t/htmldir4.t|  2 +-
 ext/Pod-Html/t/htmldir5.t|  2 +-
 ext/Pod-Html/t/htmlescp.t|  2 +-
 ext/Pod-Html/t/htmllink.t|  2 +-
 ext/Pod-Html/t/htmlview.t|  2 +-
 12 files changed, 71 insertions(+), 36 deletions(-)

diff --git a/ext/Pod-Html/lib/Pod/Html.pm b/ext/Pod-Html/lib/Pod/Html.pm
index 1972a8c2d3..8f7999b835 100644
--- a/ext/Pod-Html/lib/Pod/Html.pm
+++ b/ext/Pod-Html/lib/Pod/Html.pm
@@ -2,7 +2,7 @@ package Pod::Html;
 use strict;
 require Exporter;
 
-our $VERSION = 1.2203;
+our $VERSION = 1.23;
 our @ISA = qw(Exporter);
 our @EXPORT = qw(pod2html htmlify);
 our @EXPORT_OK = qw(anchorify);
@@ -15,6 +15,7 @@ use File::Spec;
 use File::Spec::Unix;
 use Getopt::Long;
 use Pod::Simple::Search;
+use Pod::Simple::SimpleTree ();
 use locale; # make \w work right in non-ASCII lands
 
 =head1 NAME
@@ -222,6 +223,19 @@ This program is distributed under the Artistic License.
 
 =cut
 
+# This sub duplicates the guts of Pod::Simple::FromTree.  We could have
+# used that module, except that it would have been a non-core dependency.
+sub feed_tree_to_parser {
+my($parser, $tree) = @_;
+if(ref($tree) eq "") {
+   $parser->_handle_text($tree);
+} elsif(!($tree->[0] eq "X" && $parser->nix_X_codes)) {
+   $parser->_handle_element_start($tree->[0], $tree->[1]);
+   feed_tree_to_parser($parser, $_) foreach @{$tree}[2..$#$tree];
+   $parser->_handle_element_end($tree->[0]);
+}
+}
+
 my $Cachedir; 
 my $Dircache;
 my($Htmlroot, $Htmldir, $Htmlfile, $Htmlfileurl);
@@ -273,7 +287,7 @@ sub init_globals {
 $Doindex = 1;   # non-zero if we should generate an index
 $Backlink = 0;  # no backlinks added by default
 $Header = 0;# produce block header/footer
-$Title = '';# title to give the pod(s)
+$Title = undef; # title to give the pod(s)
 }
 
 sub pod2html {
@@ -339,25 +353,60 @@ sub pod2html {
 close $cache or die "error closing $Dircache: $!";
 }
 
-# set options for the parser
-my $parser = Pod::Simple::XHTML::LocalPodLinks->new();
+my $input;
+unless (@ARGV && $ARGV[0]) {
+if ($Podfile and $Podfile ne '-') {
+$input = $Podfile;
+} else {
+$input = '-'; # XXX: make a test case for this
+}
+} else {
+$Podfile = $ARGV[0];
+$input = *ARGV;
+}
+
+# set options for input parser
+my $parser = Pod::Simple::SimpleTree->new;
+$parser->codes_in_verbatim(0);
+$parser->accept_targets(qw(html HTML));
+$parser->no_errata_section(!$Poderrors); # note the inverse
+
+warn "Converting input file $Podfile\n" if $Verbose;
+my $podtree = $parser->parse_file($input)->root;
+
+unless(defined $Title) {
+   if($podtree->[0] eq "Document" && ref($podtree->[2]) eq "ARRAY" &&
+   $podtree->[2]->[0] eq "head1" && @{$podtree->[2]} == 3 &&
+   ref($podtree->[2]->[2]) eq "" && $podtree->[2]->[2] eq "NAME" &&
+   ref($podtree->[3]) eq "ARRAY" && $podtree->[3]->[0] eq "Para" &&
+   @{$podtree->[3]} >= 3 &&
+   !(grep { ref($_) ne "" }
+   @{$po

[perl.git] branch blead updated. v5.27.6-212-gaddf67e13a

2017-12-12 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/addf67e13a08f45d3bb4c245c821b1ef2767c5a5?hp=5069e5776432678375e6753013c91c25610dd9dc>

- Log -
commit addf67e13a08f45d3bb4c245c821b1ef2767c5a5
Author: Zefram <zef...@fysh.org>
Date:   Wed Dec 13 03:50:01 2017 +

revise advice about DESTROY

perlobj advised that a DESTROY method dying could clobber $@ for an
exception being thrown, which is no longer true since 5.14.  Remove that
caveat, and fix the description of what happens when a DESTROY method
dies.  Revise the related advice about localising global status variables,
including a list of all affected variables.  Fixes [perl #121761] and
[perl #122753].

---

Summary of changes:
 pod/perlobj.pod | 25 -
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/pod/perlobj.pod b/pod/perlobj.pod
index 17d6537050..0060443e98 100644
--- a/pod/perlobj.pod
+++ b/pod/perlobj.pod
@@ -931,15 +931,22 @@ argument. It does not receive any additional arguments. 
However, the
 C<$_[0]> variable will be read-only in the destructor, so you cannot
 assign a value to it.
 
-If your C method throws an error, this error will be ignored.
-It will not be sent to C and it will not cause the program to
-die. However, if your destructor is running inside an C block,
-then the error will change the value of C<$@>.
-
-Because C methods can be called at any time, you should
-localize any global variables you might update in your C. In
-particular, if you use C you should localize C<$@>, and if you
-use C or backticks you should localize C<$?>.
+If your C method throws an exception, this will not cause
+any control transfer beyond exiting the method.  The exception will be
+reported to C as a warning, marked "(in cleanup)", and Perl will
+continue with whatever it was doing before.
+
+Because C methods can be called at any time, you should localize
+any global status variables that might be set by anything you do in
+your C method.  If you are in doubt about a particular status
+variable, it doesn't hurt to localize it.  There are five global status
+variables, and the safest way is to localize all five of them:
+
+  sub DESTROY {
+  local($., $@, $!, $^E, $?);
+  my $self = shift;
+  ...;
+  }
 
 If you define an C in your class, then Perl will call your
 C to handle the C method. You can prevent this by

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-208-g27d3197f2b

2017-12-12 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/27d3197f2b90b3534ea74a96fc7e37200baeb9b7?hp=d5407247046f2f01c1492998b32b3b148445febe>

- Log -
commit 27d3197f2b90b3534ea74a96fc7e37200baeb9b7
Author: Zefram <zef...@fysh.org>
Date:   Tue Dec 12 11:54:04 2017 +

revise doc about returning values from threads

Returning subs is now generally fine, as is creating threads in BEGIN
blocks et al.  Describe the problems that come from losing the identity
of returned objects.  Fixes [perl #96538].

---

Summary of changes:
 dist/threads/lib/threads.pm | 36 
 1 file changed, 20 insertions(+), 16 deletions(-)

diff --git a/dist/threads/lib/threads.pm b/dist/threads/lib/threads.pm
index 75251e1060..816d12415c 100644
--- a/dist/threads/lib/threads.pm
+++ b/dist/threads/lib/threads.pm
@@ -5,7 +5,7 @@ use 5.008;
 use strict;
 use warnings;
 
-our $VERSION = '2.19';  # remember to update version in POD!
+our $VERSION = '2.20';  # remember to update version in POD!
 my $XS_VERSION = $VERSION;
 $VERSION = eval $VERSION;
 
@@ -134,7 +134,7 @@ threads - Perl interpreter-based threads
 
 =head1 VERSION
 
-This document describes threads version 2.19
+This document describes threads version 2.20
 
 =head1 WARNING
 
@@ -987,13 +987,6 @@ L to relay the signal to the thread:
 On some platforms, it might not be possible to destroy I threads while
 there are still existing I threads.
 
-=item Creating threads inside special blocks
-
-Creating threads inside C, C or C blocks should not be
-relied upon.  Depending on the Perl version and the application code, results
-may range from success, to (apparently harmless) warnings of leaked scalar, or
-all the way up to crashing of the Perl interpreter.
-
 =item Unsafe signals
 
 Since Perl 5.8.0, signals have been made safer in Perl by postponing their
@@ -1018,16 +1011,27 @@ signalling behavior is only in effect in the following 
situations:
 If unsafe signals is in effect, then signal handling is not thread-safe, and
 the C<-Ekill()> signalling method cannot be used.
 
-=item Returning closures from threads
+=item Identity of objects returned from threads
+
+When a value is returned from a thread through a C operation,
+the value and everything that it references is copied across to the
+joining thread, in much the same way that values are copied upon thread
+creation.  This works fine for most kinds of value, including arrays,
+hashes, and subroutines.  The copying recurses through array elements,
+reference scalars, variables closed over by subroutines, and other kinds
+of reference.
 
-Returning closures from threads should not be relied upon.  Depending on the
-Perl version and the application code, results may range from success, to
-(apparently harmless) warnings of leaked scalar, or all the way up to crashing
-of the Perl interpreter.
+However, everything referenced by the returned value is a fresh copy in
+the joining thread, even if a returned object had in the child thread
+been a copy of something that previously existed in the parent thread.
+After joining, the parent will therefore have a duplicate of each such
+object.  This sometimes matters, especially if the object gets mutated;
+this can especially matter for private data to which a returned subroutine
+provides access.
 
-=item Returning objects from threads
+=item Returning blessed objects from threads
 
-Returning objects from threads does not work.  Depending on the classes
+Returning blessed objects from threads does not work.  Depending on the classes
 involved, you may be able to work around this by returning a serialized
 version of the object (e.g., using L or L), and then
 reconstituting it in the joining thread.  If you're using Perl 5.10.0 or

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-207-gd540724704

2017-12-12 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/d5407247046f2f01c1492998b32b3b148445febe?hp=16ada235c332e017667585e1a5a00ce43a31c529>

- Log -
commit d5407247046f2f01c1492998b32b3b148445febe
Author: Zefram <zef...@fysh.org>
Date:   Tue Dec 12 10:16:46 2017 +

better document version check aspect of "use"

---

Summary of changes:
 pod/perlfunc.pod | 9 +
 1 file changed, 9 insertions(+)

diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 0cf5031c25..18a52113be 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -9389,6 +9389,15 @@ The L method|UNIVERSAL/C>,
 inherited from the L<C|UNIVERSAL> class, croaks if the given
 version is larger than the value of the variable C<$Module::VERSION>.
 
+The VERSION argument cannot be an arbitrary expression.  It only counts
+as a VERSION argument if it is a version number literal, starting with
+either a digit or C followed by a digit.  Anything that doesn't
+look like a version literal will be parsed as the start of the LIST.
+Nevertheless, many attempts to use an arbitrary expression as a VERSION
+argument will appear to work, because L's C method
+handles numeric arguments specially, performing version checks rather
+than treating them as things to export.
+
 Again, there is a distinction between omitting LIST (L<C|/import
 LIST> called with no arguments) and an explicit empty LIST C<()>
 (L<C|/import LIST> not called).  Note that there is no comma

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-204-g397baf2320

2017-12-11 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/397baf232086e0a9ad6f881a9614d3dbaea853fc?hp=0165f7b01e9c43629d0c6f4b5eb2e672abeda51a>

- Log -
commit 397baf232086e0a9ad6f881a9614d3dbaea853fc
Author: Zefram <zef...@fysh.org>
Date:   Tue Dec 12 06:24:01 2017 +

properly check readpipe()'s argument list

readpipe() wasn't applying context to its argument list, resulting in
readpipe()'s context leaking in, and broken stack discipline when a list
expression was used.  Fixes [perl #4574].

---

Summary of changes:
 op.c|  1 +
 t/op/exec.t | 27 ---
 2 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/op.c b/op.c
index 1d31928882..74de752405 100644
--- a/op.c
+++ b/op.c
@@ -10907,6 +10907,7 @@ Perl_ck_backtick(pTHX_ OP *o)
 OP *newop = NULL;
 OP *sibl;
 PERL_ARGS_ASSERT_CK_BACKTICK;
+o = ck_fun(o);
 /* qx and `` have a null pushmark; CORE::readpipe has only one kid. */
 if (o->op_flags & OPf_KIDS && (sibl = OpSIBLING(cUNOPo->op_first))
  && (gv = gv_override("readpipe",8)))
diff --git a/t/op/exec.t b/t/op/exec.t
index 5a0f7b5601..b55cbda09c 100644
--- a/t/op/exec.t
+++ b/t/op/exec.t
@@ -36,7 +36,7 @@ $ENV{LANGUAGE} = 'C'; # Ditto in GNU.
 my $Is_VMS   = $^O eq 'VMS';
 my $Is_Win32 = $^O eq 'MSWin32';
 
-plan(tests => 29);
+plan(tests => 38);
 
 my $Perl = which_perl();
 
@@ -128,8 +128,29 @@ is( <<~`END`,   "ok\n", '<<~`HEREDOC`' 
);
   END
 
 {
-local $_ = qq($Perl -le "print 'ok'");
-is( readpipe, "ok\n", 'readpipe default argument' );
+sub rpecho { qq($Perl -le "print '$_[0]'") }
+is scalar(readpipe(rpecho("b"))), "b\n",
+   "readpipe with one argument in scalar context";
+is join(",", "a", readpipe(rpecho("b")), "c"), "a,b\n,c",
+   "readpipe with one argument in list context";
+local $_ = rpecho("f");
+is scalar(readpipe), "f\n",
+   "readpipe default argument in scalar context";
+is join(",", "a", readpipe, "c"), "a,f\n,c",
+   "readpipe default argument in list context";
+sub rpechocxt {
+   rpecho(wantarray ? "list" : defined(wantarray) ? "scalar" : "void");
+}
+is scalar(readpipe(rpechocxt())), "scalar\n",
+   "readpipe argument context in scalar context";
+is join(",", "a", readpipe(rpechocxt()), "b"), "a,scalar\n,b",
+   "readpipe argument context in list context";
+foreach my $args ("(\$::p,\$::q)", "((\$::p,\$::q))") {
+   foreach my $lvalue ("my \$r", "my \@r") {
+   eval("$lvalue = readpipe$args if 0");
+   like $@, qr/\AToo many arguments for /;
+   }
+}
 }
 
 package o {

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-203-g0165f7b01e

2017-12-11 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/0165f7b01e9c43629d0c6f4b5eb2e672abeda51a?hp=dd9e86b4501b7c8aeba1f5ebda9f8907747c443f>

- Log -
commit 0165f7b01e9c43629d0c6f4b5eb2e672abeda51a
Author: Zefram <zef...@fysh.org>
Date:   Tue Dec 12 03:53:33 2017 +

fix doc about filter subroutines' $_[0]

Filter subroutines established by an @INC callback have always received
a numeric zero as their first argument, not a referencet to the sub
as documented.  Fixes [perl #115754].

---

Summary of changes:
 pod/perlfunc.pod | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 8e3a9079b5..0cf5031c25 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -6507,11 +6507,12 @@ subroutine will be called to act as a simple source 
filter, with the
 line as read in L<C<$_>|perlvar/$_>.
 Again, return 1 for each valid line, and 0 after all lines have been
 returned.
+For historical reasons the subroutine will receive a meaningless argument
+(in fact always the numeric value zero) as C<$_[0]>.
 
 =item 4
 
-Optional state for the subroutine.  The state is passed in as C<$_[1]>.  A
-reference to the subroutine itself is passed in as C<$_[0]>.
+Optional state for the subroutine.  The state is passed in as C<$_[1]>.
 
 =back
 

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-202-gdd9e86b450

2017-12-11 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/dd9e86b4501b7c8aeba1f5ebda9f8907747c443f?hp=f8edfb87c2ebbcbe6d91f1cc4cbd0f085d3b44c1>

- Log -
commit dd9e86b4501b7c8aeba1f5ebda9f8907747c443f
Author: Zefram <zef...@fysh.org>
Date:   Tue Dec 12 03:19:26 2017 +

correct detection of arg absence in Data::Dumper

The combined getter/setter methods were mistaking a supplied undef
argument value (of a setter call) for absence of an argument (making it
a getter call).  Fixes [perl #113090].

---

Summary of changes:
 dist/Data-Dumper/Dumper.pm| 42 +--
 dist/Data-Dumper/t/indent.t   |  8 +
 dist/Data-Dumper/t/misc.t | 16 +-
 dist/Data-Dumper/t/purity_deepcopy_maxdepth.t | 17 +--
 dist/Data-Dumper/t/quotekeys.t|  5 ++--
 dist/Data-Dumper/t/terse.t| 33 +++--
 6 files changed, 36 insertions(+), 85 deletions(-)

diff --git a/dist/Data-Dumper/Dumper.pm b/dist/Data-Dumper/Dumper.pm
index 441e97329e..41433fc533 100644
--- a/dist/Data-Dumper/Dumper.pm
+++ b/dist/Data-Dumper/Dumper.pm
@@ -10,7 +10,7 @@
 package Data::Dumper;
 
 BEGIN {
-$VERSION = '2.168'; # Don't forget to set version and release
+$VERSION = '2.169'; # Don't forget to set version and release
 }   # date in POD below!
 
 #$| = 1;
@@ -627,7 +627,7 @@ sub Reset {
 
 sub Indent {
   my($s, $v) = @_;
-  if (defined($v)) {
+  if (@_ >= 2) {
 if ($v == 0) {
   $s->{xpad} = "";
   $s->{sep} = "";
@@ -646,92 +646,92 @@ sub Indent {
 
 sub Trailingcomma {
   my($s, $v) = @_;
-  defined($v) ? (($s->{trailingcomma} = $v), return $s) : $s->{trailingcomma};
+  @_ >= 2 ? (($s->{trailingcomma} = $v), return $s) : $s->{trailingcomma};
 }
 
 sub Pair {
 my($s, $v) = @_;
-defined($v) ? (($s->{pair} = $v), return $s) : $s->{pair};
+@_ >= 2 ? (($s->{pair} = $v), return $s) : $s->{pair};
 }
 
 sub Pad {
   my($s, $v) = @_;
-  defined($v) ? (($s->{pad} = $v), return $s) : $s->{pad};
+  @_ >= 2 ? (($s->{pad} = $v), return $s) : $s->{pad};
 }
 
 sub Varname {
   my($s, $v) = @_;
-  defined($v) ? (($s->{varname} = $v), return $s) : $s->{varname};
+  @_ >= 2 ? (($s->{varname} = $v), return $s) : $s->{varname};
 }
 
 sub Purity {
   my($s, $v) = @_;
-  defined($v) ? (($s->{purity} = $v), return $s) : $s->{purity};
+  @_ >= 2 ? (($s->{purity} = $v), return $s) : $s->{purity};
 }
 
 sub Useqq {
   my($s, $v) = @_;
-  defined($v) ? (($s->{useqq} = $v), return $s) : $s->{useqq};
+  @_ >= 2 ? (($s->{useqq} = $v), return $s) : $s->{useqq};
 }
 
 sub Terse {
   my($s, $v) = @_;
-  defined($v) ? (($s->{terse} = $v), return $s) : $s->{terse};
+  @_ >= 2 ? (($s->{terse} = $v), return $s) : $s->{terse};
 }
 
 sub Freezer {
   my($s, $v) = @_;
-  defined($v) ? (($s->{freezer} = $v), return $s) : $s->{freezer};
+  @_ >= 2 ? (($s->{freezer} = $v), return $s) : $s->{freezer};
 }
 
 sub Toaster {
   my($s, $v) = @_;
-  defined($v) ? (($s->{toaster} = $v), return $s) : $s->{toaster};
+  @_ >= 2 ? (($s->{toaster} = $v), return $s) : $s->{toaster};
 }
 
 sub Deepcopy {
   my($s, $v) = @_;
-  defined($v) ? (($s->{deepcopy} = $v), return $s) : $s->{deepcopy};
+  @_ >= 2 ? (($s->{deepcopy} = $v), return $s) : $s->{deepcopy};
 }
 
 sub Quotekeys {
   my($s, $v) = @_;
-  defined($v) ? (($s->{quotekeys} = $v), return $s) : $s->{quotekeys};
+  @_ >= 2 ? (($s->{quotekeys} = $v), return $s) : $s->{quotekeys};
 }
 
 sub Bless {
   my($s, $v) = @_;
-  defined($v) ? (($s->{'bless'} = $v), return $s) : $s->{'bless'};
+  @_ >= 2 ? (($s->{'bless'} = $v), return $s) : $s->{'bless'};
 }
 
 sub Maxdepth {
   my($s, $v) = @_;
-  defined($v) ? (($s->{'maxdepth'} = $v), return $s) : $s->{'maxdepth'};
+  @_ >= 2 ? (($s->{'maxdepth'} = $v), return $s) : $s->{'maxdepth'};
 }
 
 sub Maxrecurse {
   my($s, $v) = @_;
-  defined($v) ? (($s->{'maxrecurse'} = $v), return $s) : $s->{'maxrecurse'};
+  @_ >= 2 ? (($s->{'maxrecurse'} = $v), return $s) : $s->{'maxrecurse'};
 }
 
 sub Useperl {
   my($s, $v) = @_;
-  defined($v) ? (($s->{'useperl'} = $v), return $s) : $s->{'useperl'};
+  @_ >= 2 ? (($s->{'useperl'} = $v), return $s) : $s->{'useperl'};
 }
 
 sub Sortkeys {
   my($s, $v) = @_;
-  defined($v) ? (($s->{'sortkeys'} = $v), return $s) : $s->{'sortkeys'};
+  @_ >= 2 ? (($s->{'sortkeys'} = $v), return $s) : $s->{'sortkeys'};
 }
 
 sub Deparse {
   my($s, $v) = @_;
-  defined($v) ? (($s->{'deparse'} = $v), return $s) : $s->{'deparse'};
+  @_ >= 2 ? (

[perl.git] branch zefram/deprecate_some_fake_import created. v5.27.6-196-gca0f6c3b73

2017-12-11 Thread Zefram
In perl.git, the branch zefram/deprecate_some_fake_import has been created

<https://perl5.git.perl.org/perl.git/commitdiff/ca0f6c3b7340b77fc40d65a881c53c9c40be4dde?hp=>

at  ca0f6c3b7340b77fc40d65a881c53c9c40be4dde (commit)

- Log -
commit ca0f6c3b7340b77fc40d65a881c53c9c40be4dde
Author: Zefram <zef...@fysh.org>
Date:   Tue Dec 12 01:16:59 2017 +

deprecate worst uses of fake import/unimport

Calling a non-existent "import" method with arguments, or calling a
non-existent "unimport" method at all, is deprecated.  The xsub CVs
generated in gv_fetchmethod_pvn_flags() now have custom bodies that
generate the deprecation warnings, and UNIVERSAL::import() imitates that.
A handful of faulty uses of non-existent "import" methods, shown up by
the deprecation, are rectified.  [perl #132425]

---

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-195-g9b91093d3e

2017-12-11 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/9b91093d3e74d13a6e4f67269a587f4ab397998a?hp=2ae26641a3d7283c7b9df71fd2a4bb202a1bcb36>

- Log -
commit 9b91093d3e74d13a6e4f67269a587f4ab397998a
Author: Zefram <zef...@fysh.org>
Date:   Mon Dec 11 21:25:38 2017 +

document rules for identifying smoke-me branches

---

Summary of changes:
 pod/perlgit.pod | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/pod/perlgit.pod b/pod/perlgit.pod
index d8d75c1cb0..000d6ac0d4 100644
--- a/pod/perlgit.pod
+++ b/pod/perlgit.pod
@@ -852,6 +852,9 @@ on other OSes test the change before you commit it to blead.
 Fortunately, there is a way to get your change smoke-tested on various
 OSes: push it to a "smoke-me" branch and wait for certain automated
 smoke-testers to report the results from their OSes.
+A "smoke-me" branch is identified by the branch name: specifically, as
+seen on perl5.git.perl.org it must be a local branch whose first name
+component is precisely C.
 
 The procedure for doing this is roughly as follows (using the example of
 of tonyc's smoke-me branch called win32stat):

-- 
Perl5 Master Repository


[perl.git] branch smoke-me/zefram/exec_args created. v5.27.6-150-g1cd4fed954

2017-12-11 Thread Zefram
In perl.git, the branch smoke-me/zefram/exec_args has been created

<https://perl5.git.perl.org/perl.git/commitdiff/1cd4fed954752f6b49e30758b5ab8057337b5674?hp=>

at  1cd4fed954752f6b49e30758b5ab8057337b5674 (commit)

- Log -
---

-- 
Perl5 Master Repository


[perl.git] branch zefram/smoke-me/exec_args deleted. v5.27.6-150-g1cd4fed954

2017-12-11 Thread Zefram
In perl.git, the branch zefram/smoke-me/exec_args has been deleted

<https://perl5.git.perl.org/perl.git/commitdiff/?hp=1cd4fed954752f6b49e30758b5ab8057337b5674>

   was  1cd4fed954752f6b49e30758b5ab8057337b5674

- Log -
1cd4fed954752f6b49e30758b5ab8057337b5674 make exec keep its argument list more 
reliably
---

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-183-gb5145c7d47

2017-12-10 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/b5145c7d479fcfcb104fc6d3d89b4d757ca3cd15?hp=cc85e83f9e22c43fcb37b072c8d9d20a3e8d9a64>

- Log -
commit b5145c7d479fcfcb104fc6d3d89b4d757ca3cd15
Author: Zefram <zef...@fysh.org>
Date:   Mon Dec 11 00:28:43 2017 +

revise documentation about set-id

perlsec's section on set-id scripts was written confusingly, with several
half-formed references to the long-ago-deleted suidperl, and with temporal
references that are well out of date.  Revise that section, and slightly
expand the perldiag entry for the message about detecting a set-id script.
Add another section to perlsec about sudo.  Fixes [perl #74142].

---

Summary of changes:
 pod/perldiag.pod |  6 +++--
 pod/perlsec.pod  | 75 +---
 2 files changed, 59 insertions(+), 22 deletions(-)

diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index cfc8528be0..f813a87a89 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -7546,8 +7546,10 @@ the end of the string being unpacked.  See 
L.
 
 (F) And you probably never will, because you probably don't have the
 sources to your kernel, and your vendor probably doesn't give a rip
-about what you want.  Your best bet is to put a setuid C wrapper around
-your script.
+about what you want.  There is a vulnerability anywhere that you have a
+set-id script, and to close it you need to remove the set-id bit from
+the script that you're attempting to run.  To actually run the script
+set-id, your best bet is to put a set-id C wrapper around your script.
 
 =item You need to quote "%s"
 
diff --git a/pod/perlsec.pod b/pod/perlsec.pod
index ab126f753e..bf1c9b4974 100644
--- a/pod/perlsec.pod
+++ b/pod/perlsec.pod
@@ -370,7 +370,7 @@ abusing perl bugs to make the host interpreter crash or 
behave in
 unpredictable ways.  In any case it's better avoided completely if you're
 really concerned about security.
 
-=head2 Security Bugs
+=head2 Shebang Race Condition
 
 Beyond the obvious problems that stem from giving special privileges to
 systems as flexible as scripts, on many versions of Unix, set-id scripts
@@ -380,14 +380,34 @@ see which interpreter to run and when the (now-set-id) 
interpreter turns
 around and reopens the file to interpret it, the file in question may have
 changed, especially if you have symbolic links on your system.
 
-Fortunately, sometimes this kernel "feature" can be disabled.
-Unfortunately, there are two ways to disable it.  The system can simply
-outlaw scripts with any set-id bit set, which doesn't help much.
-Alternately, it can simply ignore the set-id bits on scripts.
+Some Unices, especially more recent ones, are free of this
+inherent security bug.  On such systems, when the kernel passes the name
+of the set-id script to open to the interpreter, rather than using a
+pathname subject to meddling, it instead passes I.  This is a
+special file already opened on the script, so that there can be no race
+condition for evil scripts to exploit.  On these systems, Perl should be
+compiled with C<-DSETUID_SCRIPTS_ARE_SECURE_NOW>.  The F
+program that builds Perl tries to figure this out for itself, so you
+should never have to specify this yourself.  Most modern releases of
+SysVr4 and BSD 4.4 use this approach to avoid the kernel race condition.
 
-However, if the kernel set-id script feature isn't disabled, Perl will
-complain loudly that your set-id script is insecure.  You'll need to
-either disable the kernel set-id script feature, or put a C wrapper around
+If you don't have the safe version of set-id scripts, all is not lost.
+Sometimes this kernel "feature" can be disabled, so that the kernel
+either doesn't run set-id scripts with the set-id or doesn't run them
+at all.  Either way avoids the exploitability of the race condition,
+but doesn't help in actually running scripts set-id.
+
+If the kernel set-id script feature isn't disabled, then any set-id
+script provides an exploitable vulnerability.  Perl can't avoid being
+exploitable, but will point out vulnerable scripts where it can.  If Perl
+detects that it is being applied to a set-id script then it will complain
+loudly that your set-id script is insecure, and won't run it.  When Perl
+complains, you need to remove the set-id bit from the script to eliminate
+the vulnerability.  Refusing to run the script doesn't in itself close
+the vulnerability; it is just Perl's way of encouraging you to do this.
+
+To actually run a script set-id, if you don't have the safe version of
+set-id scripts, you'll need to put a C wrapper around
 the script.  A C wrapper is just a compiled program that does nothing
 except call your Perl program.   Compiled programs are not subject to the
 kernel b

[perl.git] branch blead updated. v5.27.6-182-gcc85e83f9e

2017-12-10 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/cc85e83f9e22c43fcb37b072c8d9d20a3e8d9a64?hp=3b2fee47cdd823a304d1ec8183060c268f39c6d3>

- Log -
commit cc85e83f9e22c43fcb37b072c8d9d20a3e8d9a64
Author: Zefram <zef...@fysh.org>
Date:   Sun Dec 10 23:20:18 2017 +

assert well-formedness of argv in perl_parse()

---

Summary of changes:
 perl.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/perl.c b/perl.c
index c7673fc511..dabe45d42e 100644
--- a/perl.c
+++ b/perl.c
@@ -1693,6 +1693,13 @@ perl_parse(pTHXx_ XSINIT_t xsinit, int argc, char 
**argv, char **env)
 }
 #endif
 
+{
+   int i;
+   assert(argc >= 0);
+   for(i = 0; i != argc; i++)
+   assert(argv[i]);
+   assert(!argv[argc]);
+}
 PL_origargc = argc;
 PL_origargv = argv;
 

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-181-g3b2fee47cd

2017-12-10 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/3b2fee47cdd823a304d1ec8183060c268f39c6d3?hp=0301e899536a22752f40481d8a1d141b7a7dda82>

- Log -
commit 3b2fee47cdd823a304d1ec8183060c268f39c6d3
Author: Zefram <zef...@fysh.org>
Date:   Sun Dec 10 22:23:31 2017 +

remove incorrect doc para about exit from BEGIN

I misinterpreted the behaviour of exit from BEGIN when writing that
paragraph.  exit from BEGIN actually does cause perl_parse() to return
normally, but perl_run() wouldn't subsequently do anything.

---

Summary of changes:
 perl.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/perl.c b/perl.c
index 918854bb00..c7673fc511 100644
--- a/perl.c
+++ b/perl.c
@@ -1644,13 +1644,6 @@ zero exit code can be augmented with a set bit that will 
be ignored.
 In any case, this function is not the correct place to acquire an exit
 code: one should get that from L.
 
-In most cases, if something happens during initialisation and parsing
-that causes the Perl interpreter to want to exit, this will cause this
-function to return normally with a non-zero return value.  Historically,
-a call to the Perl built-in function C from inside a C
-block has been an exception, causing the process to actually exit.
-That behaviour may change in the future.
-
 =cut
 */
 

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-180-g0301e89953

2017-12-10 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/0301e899536a22752f40481d8a1d141b7a7dda82?hp=c9ffefcc81905ed7e70f5e766cd1a0f2f7d90d51>

- Log -
commit 0301e899536a22752f40481d8a1d141b7a7dda82
Author: Zefram <zef...@fysh.org>
Date:   Sun Dec 10 21:37:16 2017 +

properly define perl_parse() return value

perl_parse()'s return value has historically had conflicting purposes.
perlmain.c uses it as a truth value, but perlembed.pod has shown it being
used as an exit code.  perl_parse() has not had its own documentation.
What the function has actually done is to return zero for normal
completion and an exit code for early termination.  For this to be
a usable convention depended on early termination never using exit
code 0, and that's specifically *native* exit code 0, which could have
any significance.  In fact exit code 0 could arise for a compile-time
termination even on Unix through "CHECK { exit 0 }", and the mishandling
of that situation was bug [perl #2754].

Since perl_destruct() provides a native exit code unencumbered by any
attempt to simultaneously be a truth value, perl_parse() doesn't really
need to provide an exit code.  So define that perl_parse()'s return
value is principally a truth value.  Change the perlembed tutorial to
show it being so used, with an exit code coming from perl_destruct().
However, most of the historical usage of perl_parse()'s return value
as an exit code can be preserved.  Make it return 0x100 for exit(0),
which both serves as the essential truth value and on Unix also serves
as the proper exit code, because that set bit will be masked off when
actually exiting.  This works on Unix but will have variable effect on
other OSes; at least it will reliably indicate an actual exit.

perl_run() has a similar problem in the interpretation of its return
value, but not affecting the main perl executable, because perlmain.c
ignores its return value.  Similarly define that it is principally a
truth value, with preserved usage of non-zero return values as exit
codes, with exit code 0 transformed into 0x100.  This requires some
extra logic to distinguish between local completion and exit(0), which
were not previously distinguished.

Fully document perl_parse(), perl_run(), and perl_destruct() as API
functions.  Make the perlembed tutorial always show a proper exit
from main(), using "exit(EXIT_SUCCESS)" for portability when errors
are not being checked.  Make perlembed always show a null argv[argc]
being supplied to perl_parse(), where an argv is constructed.  (Commit
54c85bb058e15520a2fc0ba34007743aae56be34 added a note to perlembed saying
that that's required, but didn't fix the examples to show it being done.)

---

Summary of changes:
 perl.c| 147 +-
 pod/perlembed.pod |  30 ++-
 t/op/blocks.t |  17 ---
 3 files changed, 163 insertions(+), 31 deletions(-)

diff --git a/perl.c b/perl.c
index a81ffd0eb0..918854bb00 100644
--- a/perl.c
+++ b/perl.c
@@ -593,9 +593,33 @@ Perl_dump_sv_child(pTHX_ SV *sv)
 #endif
 
 /*
-=for apidoc perl_destruct
-
-Shuts down a Perl interpreter.  See L.
+=for apidoc Am|int|perl_destruct|PerlInterpreter *my_perl
+
+Shuts down a Perl interpreter.  See L for a tutorial.
+
+C points to the Perl interpreter.  It must have been previously
+created through the use of L and L.  It may
+have been initialised through L, and may have been used
+through L and other means.  This function should be called for
+any Perl interpreter that has been constructed with L,
+even if subsequent operations on it failed, for example if L
+returned a non-zero value.
+
+If the interpreter's C word has the
+C flag set, then this function will execute code
+in C blocks before performing the rest of destruction.  If it is
+desired to make any use of the interpreter between L and
+L other than just calling L, then this flag
+should be set early on.  This matters if L will not be called,
+or if anything else will be done in addition to calling L.
+
+Returns a value be a suitable value to pass to the C library function
+C (or to return from C), to serve as an exit code indicating
+the nature of the way the interpreter terminated.  This takes into account
+any failure of L and any early exit from L.
+The exit code is of the type required by the host operating system,
+so because of differing exit code conventions it is not portable to
+interpret specific numeric values as having specific meanings.
 
 =cut
 */
@@ -1570,9 +1594,62 @@ Perl_call_atexit(pTHX_ ATEXIT_t fn, void *ptr)
 }
 
 /*
-=for apidoc perl_parse
-
-Tells a Perl interprete

[perl.git] branch blead updated. v5.27.6-174-gdb9848c8d3

2017-12-09 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/db9848c8d3fb321d27f38c1bd7992005a77ccfbc?hp=ed55dc190542e7407287d08246600d9232656f01>

- Log -
commit db9848c8d3fb321d27f38c1bd7992005a77ccfbc
Author: Zefram <zef...@fysh.org>
Date:   Sun Dec 10 01:34:04 2017 +

stop gensyming when vivifying IO handles

When open() is given as a handle a scalar with undef value, the rv2gv
op creates a new glob for the I/O handle, and mutates the scalar to
contain an RV referencing the glob.  This is documented behaviour.
The question arises of what GvNAME the glob should have.  There's some
compile-time logic that spots that this might happen, and if the handle
expression is simple enough it stores in the pad a name representing
that expression, and rv2gv uses that for the GvNAME.  But if no name
was supplied by that route then rv2gv was using newGVgen() to generate
the glob.  That succeeds in giving it some kind of name, but has the
unwanted side effect of interning the glob in the stash under that name.
From the user's point of view, that creates a phantom reference to the
glob, which means that killing the RV doesn't remove the last reference
to the glob and so doesn't close the handle.

Instead of gensyming, just create an uninterned glob and give it a
fixed GvNAME.  Fixes [perl #115814].

---

Summary of changes:
 pp.c   | 12 +---
 t/io/open.t| 29 ++---
 t/op/coreamp.t |  2 +-
 3 files changed, 32 insertions(+), 11 deletions(-)

diff --git a/pp.c b/pp.c
index 130019f056..3ef23cae59 100644
--- a/pp.c
+++ b/pp.c
@@ -129,20 +129,18 @@ S_rv2gv(pTHX_ SV *sv, const bool vivify_sv, const bool 
strict,
 */
if (vivify_sv && sv != _sv_undef) {
GV *gv;
+   HV *stash;
if (SvREADONLY(sv))
Perl_croak_no_modify();
+   gv = MUTABLE_GV(newSV(0));
+   stash = CopSTASH(PL_curcop);
+   if (SvTYPE(stash) != SVt_PVHV) stash = NULL;
if (cUNOP->op_targ) {
SV * const namesv = PAD_SV(cUNOP->op_targ);
-   HV *stash = CopSTASH(PL_curcop);
-   if (SvTYPE(stash) != SVt_PVHV) stash = NULL;
-   gv = MUTABLE_GV(newSV(0));
gv_init_sv(gv, stash, namesv, 0);
}
else {
-   const char * const name = CopSTASHPV(PL_curcop);
-   gv = newGVgen_flags(name,
-HvNAMEUTF8(CopSTASH(PL_curcop)) ? SVf_UTF8 : 0 
);
-   SvREFCNT_inc_simple_void_NN(gv);
+   gv_init_pv(gv, stash, "__ANONIO__", 0);
}
prepare_SV_for_RV(sv);
SvRV_set(sv, MUTABLE_SV(gv));
diff --git a/t/io/open.t b/t/io/open.t
index 6be9f0e842..2671c1a040 100644
--- a/t/io/open.t
+++ b/t/io/open.t
@@ -10,7 +10,7 @@ $|  = 1;
 use warnings;
 use Config;
 
-plan tests => 156;
+plan tests => 161;
 
 my $Perl = which_perl();
 
@@ -485,5 +485,28 @@ pass("no crash when open autovivifies glob in freed 
package");
 unlink "$fh";
 }
 
-package OverloadTest;
-use overload '""' => sub { ${$_[0]} };
+{
+package OverloadTest;
+use overload '""' => sub { ${$_[0]} };
+}
+
+# [perl #115814] open(${\$x}, ...) creates spurious reference to handle in 
stash
+SKIP: {
+# The bug doesn't depend on perlio, but perlio provides this nice
+# way of discerning when a handle actually closes.
+skip("These tests use perlio", 5) unless $Config{useperlio};
+my($a, $b, $s, $t);
+$s = "";
+open($a, ">:scalar:perlio", \$s) or die;
+print {$a} "abc";
+is $s, "", "buffering delays writing to scalar (simple open)";
+$a = undef;
+is $s, "abc", "buffered write happens on dropping handle ref (simple 
open)";
+$t = "";
+open(${\$b}, ">:scalar:perlio", \$t) or die;
+print {$b} "xyz";
+is $t, "", "buffering delays writing to scalar (complex open)";
+$b = undef;
+is $t, "xyz", "buffered write happens on dropping handle ref (complex 
open)";
+is scalar(grep { /\A_GEN_/ } keys %::), 0, "no gensym appeared in stash";
+}
diff --git a/t/op/coreamp.t b/t/op/coreamp.t
index 277ac1094a..7231d66e81 100644
--- a/t/op/coreamp.t
+++ b/t/op/coreamp.t
@@ -881,7 +881,7 @@ is , select, ' with no args';
   my $prev = select;
   is (my $fh), $prev, '($arg) retval';
   is lc ref $fh, 'glob', ' autovivifies';
-  is select=~s/\*//rug, (*$fh."")=~s/\*//rug, ' selects';
+  is select, $fh, ' selects';
   select $prev;
 }
 eval { (1,2) };

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-156-g5d4548b73b

2017-12-07 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/5d4548b73b1d6298ebeef6d93e510cc249106b85?hp=19a498a461d7c81ae3507c450953d1148efecf4f>

- Log -
commit 5d4548b73b1d6298ebeef6d93e510cc249106b85
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 8 00:11:59 2017 +

delete duplicate _qq from test

Commit af05e4c0b428a803fcdb60c956b1da7ff8a95926 added a _qq() sub
to t/re/reg_mesg.t that duplicates both the intent and the name of
t/test.pl's _qq(), causing a redefinition warning.  Remove the new _qq(),
because t/test.pl's version is better.

commit 9291839cdbaa256b811274b66910a960a7f3b06d
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 8 00:03:16 2017 +

assert min identifier length in S_pending_ident()

---

Summary of changes:
 t/re/reg_mesg.t | 8 
 toke.c  | 1 +
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/t/re/reg_mesg.t b/t/re/reg_mesg.t
index 24cd986960..2e3ed07ff7 100644
--- a/t/re/reg_mesg.t
+++ b/t/re/reg_mesg.t
@@ -65,14 +65,6 @@ sub add_markers {
 return $element;
 }
 
-sub _qq {
-my ($str)= @_;
-$str =~ s/\\//g;
-$str =~ s/\$/\\\$/g;
-return qq("$str");
-}
-
-
 ## Because we don't "use utf8" in this file, we need to do some extra legwork
 ## for the utf8 tests: Prepend 'use utf8' to the pattern, and mark the strings
 ## to check against as UTF-8, but for this all to work properly, the character
diff --git a/toke.c b/toke.c
index 5aeec6fc65..a4150c2f05 100644
--- a/toke.c
+++ b/toke.c
@@ -8943,6 +8943,7 @@ S_pending_ident(pTHX)
 
 DEBUG_T({ PerlIO_printf(Perl_debug_log,
   "### Pending identifier '%s'\n", PL_tokenbuf); });
+assert(tokenbuf_len >= 2);
 
 /* if we're in a my(), we can't allow dynamics here.
$foo'bar has already been turned into $foo::bar, so

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-150-g6c4f4eb174

2017-12-06 Thread Zefram
In perl.git, the branch blead has been updated



- Log -
commit 6c4f4eb174d1e2e9f874786123a699d11ae741f9
Author: Tony Cook 
Date:   Mon Aug 14 15:10:22 2017 +1000

prevent integer overflow when compiling a regexp

Fixes [perl #131893].

---

Summary of changes:
 regcomp.c  | 8 ++--
 t/re/pat.t | 6 +-
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/regcomp.c b/regcomp.c
index fcedc3629f..c01fec6fe6 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -5941,8 +5941,12 @@ Perl_re_printf( aTHX_  "LHS=%" UVuf " RHS=%" UVuf "\n",
 data->cur_is_floating = 1; /* float */
 }
 min += min1;
-if (delta != SSize_t_MAX)
-delta += max1 - min1;
+if (delta != SSize_t_MAX) {
+if (SSize_t_MAX - (max1 - min1) >= delta)
+delta += max1 - min1;
+else
+delta = SSize_t_MAX;
+}
 if (flags & SCF_DO_STCLASS_OR) {
 ssc_or(pRExC_state, data->start_class, (regnode_charclass *) 
);
 if (min1) {
diff --git a/t/re/pat.t b/t/re/pat.t
index 66fe6f34fd..27d9833714 100644
--- a/t/re/pat.t
+++ b/t/re/pat.t
@@ -23,7 +23,7 @@ BEGIN {
 skip_all('no re module') unless defined ::boot_DynaLoader;
 skip_all_without_unicode_tables();
 
-plan tests => 844;  # Update this when adding/deleting tests.
+plan tests => 845;  # Update this when adding/deleting tests.
 
 run_tests() unless caller;
 
@@ -1921,6 +1921,10 @@ EOP
 # [perl #129281] buffer write overflow, detected by ASAN, valgrind
 fresh_perl_is('/0(?0)|^*0(?0)|^*(^*())0|/', '', {}, "don't bump 
whilem_c too much");
 }
+{
+# RT #131893 - fails with ASAN -fsanitize=undefined
+fresh_perl_is('qr/0(0?(0||00*))|/', '', {}, "integer overflow during 
compilation");
+}
 
 {
 # RT #131575 intuit skipping back from the end to find the highest

-- 
Perl5 Master Repository


[perl.git] branch zefram/smoke-me/exec_args created. v5.27.6-150-g1cd4fed954

2017-12-06 Thread Zefram
In perl.git, the branch zefram/smoke-me/exec_args has been created

<https://perl5.git.perl.org/perl.git/commitdiff/1cd4fed954752f6b49e30758b5ab8057337b5674?hp=>

at  1cd4fed954752f6b49e30758b5ab8057337b5674 (commit)

- Log -
commit 1cd4fed954752f6b49e30758b5ab8057337b5674
Author: Zefram <zef...@fysh.org>
Date:   Wed Dec 6 21:27:15 2017 +

make exec keep its argument list more reliably

Bits of exec code were putting the constructed commands into globals
PL_Argv and PL_Cmd, which could then be clobbered by reentrancy.
These are only global in order to manage their freeing, but that's
better managed by using the scope stack.  So replace them with automatic
variables, with ENTER/SAVEFREEPV/LEAVE to free the memory.  Also copy
the strings acquired from SVs, to avoid magic clobbering the buffers of
SVs already read.  Fixes [perl #129888].

---

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-149-g1af9149031

2017-12-06 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/1af9149031d9f5d2d43b6df59b628a0f2c1041f6?hp=bff3de19b083d33895fc03f7d7d092e5830547a5>

- Log -
commit 1af9149031d9f5d2d43b6df59b628a0f2c1041f6
Author: Zefram <zef...@fysh.org>
Date:   Wed Dec 6 18:53:16 2017 +

handle null op_next in stacked filetests

When a filetest op returns false, it skips past following ops that
are stacked filetests.  The code to do this was assuming that op_next
would always be non-null, which is not always the case, for example in
a sort comparator.  Allow for it to be null.  Fixes [perl #129347].

---

Summary of changes:
 pp_sys.c | 2 +-
 t/op/filetest_stack_ok.t | 8 +++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/pp_sys.c b/pp_sys.c
index 7a4c4ab1ef..b078586974 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3116,7 +3116,7 @@ S_ft_return_false(pTHX_ SV *ret) {
 PUTBACK;
 
 if (PL_op->op_private & OPpFT_STACKING) {
-while (OP_IS_FILETEST(next->op_type)
+while (next && OP_IS_FILETEST(next->op_type)
&& next->op_private & OPpFT_STACKED)
 next = next->op_next;
 }
diff --git a/t/op/filetest_stack_ok.t b/t/op/filetest_stack_ok.t
index ceff452da1..36da2c8725 100644
--- a/t/op/filetest_stack_ok.t
+++ b/t/op/filetest_stack_ok.t
@@ -12,7 +12,7 @@ BEGIN {
 
 my @ops = split //, 'rwxoRWXOezsfdlpSbctugkTMBAC';
 
-plan( tests => @ops * 5 );
+plan( tests => @ops * 5 + 1 );
 
 package o { use overload '-X' => sub { 1 } }
 my $o = bless [], 'o';
@@ -47,3 +47,9 @@ for my $op (@ops) {
 my @foo = eval "-$op \$o";
 is @foo, 1, "-$op \$overld did not leave \$overld on the stack";
 }
+
+{
+# [perl #129347] cope with stacked filetests where PL_op->op_next is null
+() = sort { -d -d } \*TEST0, \*TEST1;
+ok 1, "survived stacked filetests with null op_next";
+}

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-148-gbff3de19b0

2017-12-06 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/bff3de19b083d33895fc03f7d7d092e5830547a5?hp=b3893bfa90e8810497e2f81458a5a46db611cadf>

- Log -
commit bff3de19b083d33895fc03f7d7d092e5830547a5
Author: Zefram <zef...@fysh.org>
Date:   Wed Dec 6 17:41:59 2017 +

fix oct/bin fp fractions in non-HEXFP_UQUAD builds

The code for binaryish floating point literals, on builds where
we're not confident of being able to fit a significand into an
integer type, had built-in knowledge that the radix is 16, after
the radix point.  This gave erroneous values for octal and binary
literals on those builds.  This was shown up by the tests added in
commit 58be57636a42d6c6fd404c48c4e1cb87870182df.  Correct it to use the
actual radix.

---

Summary of changes:
 toke.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/toke.c b/toke.c
index 60806a749c..5aeec6fc65 100644
--- a/toke.c
+++ b/toke.c
@@ -11143,7 +11143,7 @@ Perl_scan_num(pTHX_ const char *start, YYSTYPE* lvalp)
 }
 #else /* HEXFP_NV */
 if (accumulate) {
-nv_mult /= 16.0;
+nv_mult /= nvshift[shift];
 if (nv_mult > 0.0)
 hexfp_nv += b * nv_mult;
 else

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-147-gb3893bfa90

2017-12-06 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/b3893bfa90e8810497e2f81458a5a46db611cadf?hp=f6c236a3e94d9d7cfbf3c3549ab7a5f37e416e3c>

- Log -
commit b3893bfa90e8810497e2f81458a5a46db611cadf
Author: Zefram <zef...@fysh.org>
Date:   Wed Dec 6 17:15:29 2017 +

clarify "bless" doc

A couple of points came out of discussion on [perl #124428] that are
worthy of explication.

---

Summary of changes:
 pod/perlfunc.pod | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 58bfbd4a79..98cba47edd 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -893,7 +893,9 @@ X
 =for Pod::Functions create an object
 
 This function tells the thingy referenced by REF that it is now an object
-in the CLASSNAME package.  If CLASSNAME is omitted, the current package
+in the CLASSNAME package.  If CLASSNAME is an empty string, it is
+interpreted as referring to the C package.
+If CLASSNAME is omitted, the current package
 is used.  Because a L<C|/bless REF,CLASSNAME> is often the last
 thing in a constructor, it returns the reference for convenience.
 Always use the two-argument version if a derived class might inherit the
@@ -903,8 +905,9 @@ method doing the blessing.  See L for more about 
the blessing
 Consider always blessing objects in CLASSNAMEs that are mixed case.
 Namespaces with all lowercase names are considered reserved for
 Perl pragmas.  Builtin types have all uppercase names.  To prevent
-confusion, you may wish to avoid such package names as well.  Make sure
-that CLASSNAME is a true value.
+confusion, you may wish to avoid such package names as well.
+It is advised to avoid the class name C<0>, because much code erroneously
+uses the result of L<C|/ref EXPR> as a truth value.
 
 See L.
 

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-144-g0c9c439d08

2017-12-06 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/0c9c439d08a65206d442724bcd9fb29fa5a7f937?hp=7b0ac4577d4cc7902dfa379f3318a8af1b736a3d>

- Log -
commit 0c9c439d08a65206d442724bcd9fb29fa5a7f937
Author: Zefram <zef...@fysh.org>
Date:   Wed Dec 6 16:28:18 2017 +

document hostname(@args) deprecation

Passing arguments to Sys::Hostname::hostname() is already deprecated.
Note the deprecation's agreed removal version of Perl 5.32.  Also document
it in perldeprecation.pod.  [perl #124349]

commit fada828575a05b9a655c2ba607c7c123da07a4b2
Author: Zefram <zef...@fysh.org>
Date:   Wed Dec 6 16:17:27 2017 +

fix a =head level in perldeprecation.pod

---

Summary of changes:
 ext/Sys-Hostname/Hostname.pm |  4 ++--
 pod/perldeprecation.pod  | 12 +++-
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/ext/Sys-Hostname/Hostname.pm b/ext/Sys-Hostname/Hostname.pm
index d53410e9a0..8b5dde1445 100644
--- a/ext/Sys-Hostname/Hostname.pm
+++ b/ext/Sys-Hostname/Hostname.pm
@@ -16,7 +16,7 @@ use warnings ();
 our $host;
 
 BEGIN {
-$VERSION = '1.21';
+$VERSION = '1.22';
 {
local $SIG{__DIE__};
eval {
@@ -29,7 +29,7 @@ BEGIN {
 
 
 sub hostname {
-  @_ and warnings::warnif("deprecated", "hostname() doesn't accept any 
arguments");
+  @_ and warnings::warnif("deprecated", "hostname() doesn't accept any 
arguments. This will become fatal in Perl 5.32");
 
   # method 1 - we already know it
   return $host if defined $host;
diff --git a/pod/perldeprecation.pod b/pod/perldeprecation.pod
index eb6e0f98cc..e929314a68 100644
--- a/pod/perldeprecation.pod
+++ b/pod/perldeprecation.pod
@@ -50,12 +50,22 @@ changes to the variable that it closes over, add an 
explicit C:
 
 This usage has been deprecated, and will no longer be allowed in Perl 5.32.
 
-=head2 Use of strings with code points over 0xFF as arguments to C
+=head3 Use of strings with code points over 0xFF as arguments to C
 
 C views its string argument as a sequence of bits.  A string
 containing a code point over 0xFF is nonsensical.  This usage is
 deprecated in Perl 5.28, and will be removed in Perl 5.32.
 
+=head3 hostname() doesn't accept any arguments
+
+The function C<hostname()> in the L module has always
+been documented to be called with no arguments.  Historically it has not
+enforced this, and has actually accepted and ignored any arguments.  As a
+result, some users have got the mistaken impression that an argument does
+something useful.  To avoid these bugs, the function is being made strict.
+Passing arguments was deprecated in Perl 5.28, and will become fatal in
+Perl 5.32.
+
 =head2 Perl 5.30
 
 =head3 C<< $* >> is no longer supported

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-139-gd106cb4626

2017-12-06 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/d106cb46261708412bce33e1840ae6e8c17bea20?hp=52e3acf87aacbe6b39ecb42fe0adb6c0dac1019d>

- Log -
commit d106cb46261708412bce33e1840ae6e8c17bea20
Author: Zefram <zef...@fysh.org>
Date:   Wed Dec 6 06:08:22 2017 +

remove stray NULLOK/NN from apidoc directives

---

Summary of changes:
 handy.h | 2 +-
 op.c| 2 +-
 sv.h| 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/handy.h b/handy.h
index 08a09ec326..5344f10016 100644
--- a/handy.h
+++ b/handy.h
@@ -364,7 +364,7 @@ string/length pair.
 Like C, but takes a literal string instead of a
 string/length pair.
 
-=for apidoc Am|SV**|hv_stores|HV* tb|"literal string" key|NULLOK SV* val
+=for apidoc Am|SV**|hv_stores|HV* tb|"literal string" key|SV* val
 Like C, but takes a literal string instead of a
 string/length pair
 and omits the hash parameter.
diff --git a/op.c b/op.c
index a27e4b14db..0f7ee6269b 100644
--- a/op.c
+++ b/op.c
@@ -10440,7 +10440,7 @@ Perl_newXS_deffile(pTHX_ const char *name, XSUBADDR_t 
subaddr)
 }
 
 /*
-=for apidoc m|CV *|newXS_len_flags|const char *name|STRLEN len|XSUBADDR_t 
subaddr|const char *const filename|NULLOK const char *const proto|NULLOK SV 
**const_svp|U32 flags
+=for apidoc m|CV *|newXS_len_flags|const char *name|STRLEN len|XSUBADDR_t 
subaddr|const char *const filename|const char *const proto|SV **const_svp|U32 
flags
 
 Construct an XS subroutine, also performing some surrounding jobs.
 
diff --git a/sv.h b/sv.h
index 0fdb8c84bf..1c7224277f 100644
--- a/sv.h
+++ b/sv.h
@@ -1649,7 +1649,7 @@ Like C but doesn't process magic.
 =for apidoc Am|void|sv_catsv_nomg|SV* dsv|SV* ssv
 Like C but doesn't process magic.
 
-=for apidoc Amdb|STRLEN|sv_utf8_upgrade_nomg|NN SV *sv
+=for apidoc Amdb|STRLEN|sv_utf8_upgrade_nomg|SV *sv
 
 Like C, but doesn't do magic on C.
 
@@ -2180,7 +2180,7 @@ struct clone_params {
 };
 
 /*
-=for apidoc Am|SV*|newSVpvn_utf8|NULLOK const char* s|STRLEN len|U32 utf8
+=for apidoc Am|SV*|newSVpvn_utf8|const char* s|STRLEN len|U32 utf8
 
 Creates a new SV and copies a string (which may contain C (C<\0>)
 characters) into it.  If C is true, calls
@@ -2202,7 +2202,7 @@ Creates a new SV containing the pad name.
 #define newSVpadname(pn) newSVpvn_utf8(PadnamePV(pn), PadnameLEN(pn), TRUE)
 
 /*
-=for apidoc Am|void|SvOOK_offset|NN SV*sv|STRLEN len
+=for apidoc Am|void|SvOOK_offset|SV*sv|STRLEN len
 
 Reads into C the offset from C back to the true start of the
 allocated buffer, which will be non-zero if C has been used to

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-138-g52e3acf87a

2017-12-05 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/52e3acf87aacbe6b39ecb42fe0adb6c0dac1019d?hp=58be57636a42d6c6fd404c48c4e1cb87870182df>

- Log -
commit 52e3acf87aacbe6b39ecb42fe0adb6c0dac1019d
Author: Zefram <zef...@fysh.org>
Date:   Wed Dec 6 04:00:04 2017 +

put shadowing warnings in their own category

As proposed in [perl #125330].

---

Summary of changes:
 ext/XS-APItest/t/loopblock.t |  2 +-
 ext/XS-APItest/t/looprest.t  |  2 +-
 lib/warnings.pm  | 11 +--
 pad.c|  8 
 pod/perldelta.pod|  6 ++
 pod/perldiag.pod |  8 
 regen/warnings.pl|  3 ++-
 t/lib/warnings/pad   | 42 +-
 warnings.h   |  4 
 9 files changed, 52 insertions(+), 34 deletions(-)

diff --git a/ext/XS-APItest/t/loopblock.t b/ext/XS-APItest/t/loopblock.t
index 3b688bc811..7f654a5424 100644
--- a/ext/XS-APItest/t/loopblock.t
+++ b/ext/XS-APItest/t/loopblock.t
@@ -70,7 +70,7 @@ eval q{
my $x = "a";
$t .= $x;
do {
-   no warnings "misc";
+   no warnings "shadow";
$t .= $x;
my $x = "b";
$t .= $x;
diff --git a/ext/XS-APItest/t/looprest.t b/ext/XS-APItest/t/looprest.t
index e37ef87941..aa3116daa8 100644
--- a/ext/XS-APItest/t/looprest.t
+++ b/ext/XS-APItest/t/looprest.t
@@ -66,7 +66,7 @@ eval q{
my $x = "a";
$t .= $x;
do {
-   no warnings "misc";
+   no warnings "shadow";
$t .= $x;
my $x = "b";
$t .= $x;
diff --git a/lib/warnings.pm b/lib/warnings.pm
index 64e6448a08..c6bbe8c95d 100644
--- a/lib/warnings.pm
+++ b/lib/warnings.pm
@@ -5,7 +5,7 @@
 
 package warnings;
 
-our $VERSION = "1.38";
+our $VERSION = "1.39";
 
 # Verify that we're called correctly so that warnings will work.
 # Can't use Carp, since Carp uses us!
@@ -96,6 +96,9 @@ our %Offsets = (
 
 # Warnings Categories added in Perl 5.025
 'experimental::declared_refs'  => 132,
+
+# Warnings Categories added in Perl 5.027
+'shadow'   => 134,
 );
 
 our %Bits = (
@@ -153,6 +156,7 @@ our %Bits = (
 'reserved' => 
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00", # [37]
 'semicolon'=> 
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00", # [38]
 'severe'   => 
"\x00\x00\x00\x00\x00\x54\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # 
[21..25]
+'shadow'   => 
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40", # [67]
 'signal'   => 
"\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [26]
 'substr'   => 
"\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [27]
 'surrogate'=> 
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00", # [50]
@@ -223,6 +227,7 @@ our %DeadBits = (
 'reserved' => 
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00", # [37]
 'semicolon'=> 
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00", # [38]
 'severe'   => 
"\x00\x00\x00\x00\x00\xa8\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # 
[21..25]
+'shadow'   => 
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80", # [67]
 'signal'   => 
"\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [26]
 'substr'   => 
"\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [27]
 'surrogate'=> 
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00", # [50]
@@ -241,7 +246,7 @@ our %DeadBits = (
 # These are used by various things, including our own tests
 our $NONE  =  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
 our $DEFAULT   =  
"\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x00\x55\x51\x55\x10", # 
[2,4,22,23,25,52..56,58..63,66]
-our $LAST_BIT  =  134 ;
+our $LAST_BIT  =  13

[perl.git] branch blead updated. v5.27.6-137-g58be57636a

2017-12-05 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/58be57636a42d6c6fd404c48c4e1cb87870182df?hp=38a3df78b8fbbdf02988dd5fe691c23a8041334f>

- Log -
commit 58be57636a42d6c6fd404c48c4e1cb87870182df
Author: Tony Cook <t...@develop-help.com>
Date:   Tue Sep 5 15:26:41 2017 +1000

limit digits based on radix for oct/bin fp

All hexadecimal digits were being permitted in octal and binary floating
point literals.  (That octal and binary literals are permitted at all
might be an accidental result of permitting hexadecimal?)  Restrict which
digits are permitted, in accordance with the radix.

commit 7c6e7cf06853eef1d1b271077c402c5f8655fbe6
Author: Zefram <zef...@fysh.org>
Date:   Wed Dec 6 01:40:43 2017 +

avoid negative shift in scan_num()

Lengthy binaryish floating point literals used to perform illegal bit
shifts.  Ignore digits that are past the end of the significand at an
earlier stage to avoid this.  Code fix by Tony C.  Fixes [perl #131894].

commit c86de4c07d8483411299c7c5d7d78f4fdaa4b225
Author: Zefram <zef...@fysh.org>
Date:   Wed Dec 6 01:10:31 2017 +

assert legality of bitshifts in scan_num()

[perl #131894] found some negative-exponent shifting going on here.
Make the illegality more accessible by asserting.

---

Summary of changes:
 t/lib/croak/toke | 18 ++
 t/op/hexfp.t | 26 +-
 toke.c   | 12 +---
 3 files changed, 52 insertions(+), 4 deletions(-)

diff --git a/t/lib/croak/toke b/t/lib/croak/toke
index 082761eec4..1d45a3fdf5 100644
--- a/t/lib/croak/toke
+++ b/t/lib/croak/toke
@@ -462,3 +462,21 @@ tr//\N{}-0/;
 EXPECT
 Unknown charname '' at - line 1, within string
 Execution of - aborted due to compilation errors.
+
+# NAME octal fp with non-octal digits after the decimal point
+01.1234567p0;
+07.8p0;
+EXPECT
+Bareword found where operator expected at - line 2, near "8p0"
+   (Missing operator before p0?)
+syntax error at - line 2, near "8p0"
+Execution of - aborted due to compilation errors.
+
+# NAME binary fp with non-binary digits after the decimal point
+0b1.10p0;
+0b1.2p0;
+EXPECT
+Bareword found where operator expected at - line 2, near "2p0"
+   (Missing operator before p0?)
+syntax error at - line 2, near "2p0"
+Execution of - aborted due to compilation errors.
diff --git a/t/op/hexfp.t b/t/op/hexfp.t
index 29378f29af..617c0fe44c 100644
--- a/t/op/hexfp.t
+++ b/t/op/hexfp.t
@@ -10,7 +10,7 @@ use strict;
 
 use Config;
 
-plan(tests => 109);
+plan(tests => 123);
 
 # Test hexfloat literals.
 
@@ -255,6 +255,30 @@ SKIP: {
 is(0x1p-16445, 3.6451995318824746e-4951);
 }
 
+# [perl #131894] parsing long binaryish floating point literals used to
+# perform illegal bit shifts
+SKIP: {
+skip("non-64-bit NVs", 1)
+  unless $Config{nvsize} == 8 && $Config{d_double_style_ieee};
+is sprintf("%a", eval("0x030.1p0")), "0x1.8p+53";
+is sprintf("%a", eval("0140.1p0")), "0x1.8p+54";
+is sprintf("%a", 
eval("0b11000.1p0")), 
"0x1.8p+56";
+}
+
+# the implementation also allow for octal and binary fp
+is(01p0, 1);
+is(01.0p0, 1);
+is(01.00p0, 1);
+is(010.1p0, 8.125);
+is(00.400p1, 1);
+is(00p0, 0);
+is(01.1p0, 1.125);
+
+is(0b0p0, 0);
+is(0b1p0, 1);
+is(0b10p0, 2);
+is(0b1.1p0, 1.5);
+
 # sprintf %a/%A testing is done in sprintf2.t,
 # trickier than necessary because of long doubles,
 # and because looseness of the spec.
diff --git a/toke.c b/toke.c
index 70e7de01de..60806a749c 100644
--- a/toke.c
+++ b/toke.c
@@ -10997,6 +10997,7 @@ Perl_scan_num(pTHX_ const char *start, YYSTYPE* lvalp)
  digit:
just_zero = FALSE;
if (!overflowed) {
+   assert(shift >= 0);
x = u << shift; /* make room for the digit */
 
 total_bits += shift;
@@ -11077,19 +11078,22 @@ Perl_scan_num(pTHX_ const char *start, YYSTYPE* lvalp)
 NV nv_mult = 1.0;
 #endif
 bool accumulate = TRUE;
-for (h++; (isXDIGIT(*h) || *h == '_'); h++) {
+U8 b;
+int lim = 1 << shift;
+for (h++; ((isXDIGIT(*h) && (b = XDIGIT_VALUE(*h)) < lim) 
||
+   *h == '_'); h++) {
 if (isXDIGIT(*h)) {
-U8 b = XDIGIT_VALUE(*h);
 significant_bits += shift;
 #ifdef H

[perl.git] branch blead updated. v5.27.6-134-g38a3df78b8

2017-12-05 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/38a3df78b8fbbdf02988dd5fe691c23a8041334f?hp=557714184de18964b954b2c00fa13127fd3f216a>

- Log -
commit 38a3df78b8fbbdf02988dd5fe691c23a8041334f
Author: Zefram <zef...@fysh.org>
Date:   Wed Dec 6 00:50:05 2017 +

don't mistake tr/// for assignable reference

For the lhs of an assignment to be an assignable srefgen, the
srefgen must be its top-level op.  ck_refassign() asserted that, but
S_assignment_type() was delving inside a null op looking for the srefgen,
the same way it looks for things that distinguish between scalar and
list assignment.  This showed up in a weird situation where a no-op
transliteration could be applied to an srefgen, getting an srefgen inside
a null op.  Fixes [perl #130578].

---

Summary of changes:
 op.c | 34 +-
 t/op/lvref.t |  6 +-
 2 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/op.c b/op.c
index 072d3ceb53..a27e4b14db 100644
--- a/op.c
+++ b/op.c
@@ -7579,11 +7579,24 @@ S_assignment_type(pTHX_ const OP *o)
 if (!o)
return TRUE;
 
-if ((o->op_type == OP_NULL) && (o->op_flags & OPf_KIDS))
-   o = cUNOPo->op_first;
+if (o->op_type == OP_SREFGEN)
+{
+   OP * const kid = cUNOPx(cUNOPo->op_first)->op_first;
+   type = kid->op_type;
+   flags = o->op_flags | kid->op_flags;
+   if (!(flags & OPf_PARENS)
+ && (kid->op_type == OP_RV2AV || kid->op_type == OP_PADAV ||
+ kid->op_type == OP_RV2HV || kid->op_type == OP_PADHV ))
+   return ASSIGN_REF;
+   ret = ASSIGN_REF;
+} else {
+   if ((o->op_type == OP_NULL) && (o->op_flags & OPf_KIDS))
+   o = cUNOPo->op_first;
+   flags = o->op_flags;
+   type = o->op_type;
+   ret = 0;
+}
 
-flags = o->op_flags;
-type = o->op_type;
 if (type == OP_COND_EXPR) {
 OP * const sib = OpSIBLING(cLOGOPo->op_first);
 const I32 t = assignment_type(sib);
@@ -7596,19 +7609,6 @@ S_assignment_type(pTHX_ const OP *o)
return FALSE;
 }
 
-if (type == OP_SREFGEN)
-{
-   OP * const kid = cUNOPx(cUNOPo->op_first)->op_first;
-   type = kid->op_type;
-   flags |= kid->op_flags;
-   if (!(flags & OPf_PARENS)
- && (kid->op_type == OP_RV2AV || kid->op_type == OP_PADAV ||
- kid->op_type == OP_RV2HV || kid->op_type == OP_PADHV ))
-   return ASSIGN_REF;
-   ret = ASSIGN_REF;
-}
-else ret = 0;
-
 if (type == OP_LIST &&
(flags & OPf_WANT) == OPf_WANT_SCALAR &&
o->op_private & OPpLVAL_INTRO)
diff --git a/t/op/lvref.t b/t/op/lvref.t
index a943e55a55..28adc6ad23 100644
--- a/t/op/lvref.t
+++ b/t/op/lvref.t
@@ -4,7 +4,7 @@ BEGIN {
 set_up_inc("../lib");
 }
 
-plan 155;
+plan 156;
 
 eval '\$x = \$y';
 like $@, qr/^Experimental aliasing via reference not enabled/,
@@ -488,6 +488,10 @@ eval '$foo ? \%{"42"} : \%43 = 42';
 like $@,
 qr/^Can't modify reference to hash dereference in scalar assignment a/,
"Can't modify ref to whatever in scalar assignment via cond expr";
+eval '\$0=~y///=0';
+like $@,
+qr#^Can't modify transliteration \(tr///\) in scalar assignment a#,
+   "Can't modify transliteration (tr///) in scalar assignment";
 
 # Miscellaneous
 

-- 
Perl5 Master Repository


[perl.git] branch zefram/dumb_match updated. v5.27.6-50-gd6374f3d79

2017-12-05 Thread Zefram
In perl.git, the branch zefram/dumb_match has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/d6374f3d794e2a640258023e92e8d922409215ec?hp=b1a6328e96a123f6ca713df406f01c2f4a2f2b7b>

- Log -
commit d6374f3d794e2a640258023e92e8d922409215ec
Author: Zefram <zef...@fysh.org>
Date:   Wed Dec 6 00:12:49 2017 +

perldelta for more switch changes

commit f68519ee3f12e5ba41a022ef88ce3d6c3901807f
Author: Zefram <zef...@fysh.org>
Date:   Wed Dec 6 00:09:42 2017 +

add "whereis"

"whereis" is like "whereso" except that it performs an implicit
smartmatch.

commit 84ac76a7475419f4ac6e5a6935522f7b7ebb0e2c
Author: Zefram <zef...@fysh.org>
Date:   Tue Dec 5 22:39:42 2017 +

better name for parameter to newGIVENOP()

"cond" sounds like it's a condition.  It's actually supplying a topic.

commit 15e4ac9a427692a356fe62b255db9e08982879f5
Author: Zefram <zef...@fysh.org>
Date:   Tue Dec 5 22:30:50 2017 +

internally change "when" to "whereso"

The names of ops, context types, functions, etc., all change in accordance
with the change of keyword.

commit 284a3526271b040abd48aef39f61e8bacbf16645
Author: Zefram <zef...@fysh.org>
Date:   Tue Dec 5 22:08:42 2017 +

change "when" keyword to "whereso"

commit 8c49c7c16863f886a6a4da3b585463cd16a8b976
Author: Zefram <zef...@fysh.org>
Date:   Tue Dec 5 21:36:33 2017 +

fix "LOOP_GIVEN" constant in PL_block_type[]

    Missed this earlier in commit 619bbb9ab0f3cffda05f980b2ebb5bf660ad6962.

commit 16ea2c1905a8b12a3ddd72561c74de0063cbcc40
Author: Zefram <zef...@fysh.org>
Date:   Tue Dec 5 21:24:19 2017 +

merge leavegiven op type into leaveloop

The leaveloop op type can already do the whole job, with leavegiven being
    a near duplicate of it.  Replace all uses of leavegiven with leaveloop.

commit 40b0df696c4f45c9e0e43ec2121b53bc06a586db
Author: Zefram <zef...@fysh.org>
Date:   Wed Nov 29 23:33:33 2017 +

make "outside a loop" error messages consistent

The message for leaving a "when" block outside a loop had different
wording from the message for performing "next" et al outside a loop.
Make the "when" message consistent with the existing loop control ones.

---

Summary of changes:
 MANIFEST|   3 +-
 cop.h   |  10 +-
 cpan/experimental/t/basic.t |   2 +-
 dump.c  |   2 +-
 embed.fnc   |  10 +-
 embed.h |   8 +-
 ext/Opcode/Opcode.pm|   4 +-
 gv.c|   3 +-
 inline.h|  12 +-
 keywords.c  | 113 ++-
 keywords.h  |  15 +-
 lib/B/Deparse-core.t|   3 +-
 lib/B/Deparse.pm|  39 ++--
 lib/B/Deparse.t |  40 ++--
 lib/B/Op_private.pm |   5 +-
 op.c|  41 ++--
 opcode.h|  37 ++--
 opnames.h   | 357 ++-
 perl.h  |   4 +-
 perly.act   | 428 +-
 perly.h |   4 +-
 perly.tab   |  52 +++---
 perly.y |  22 ++-
 pod/perldelta.pod   |   9 +-
 pod/perldiag.pod|  32 ++--
 pod/perlexperiment.pod  |   3 +-
 pod/perlfunc.pod|  11 +-
 pod/perlintro.pod   |   4 +-
 pod/perlsyn.pod |  83 +
 pod/perltrap.pod|   5 +-
 pp_ctl.c|  67 +++
 pp_proto.h  |   5 +-
 proto.h |  18 +-
 regen/keywords.pl   |   6 +-
 regen/opcodes   |   5 +-
 sv.c|   2 +-
 t/lib/croak/pp_ctl  |   6 +-
 t/lib/feature/switch|  40 ++--
 t/op/coreamp.t  |   8 +-
 t/op/coresubs.t |   2 +-
 t/op/cproto.t   |   5 +-
 t/op/state.t|   2 +-
 t/op/switch.t   | 446 ++--
 t/op/taint.t|   6 +-
 t/op/whereis.t  |  78 
 t/op/{when.t => whereso.t}  |  90 -
 t/porting/customized.dat|   2 +-
 t/run/switches.t|   2 +-
 toke.c  |  12 +-
 49 files changed, 1160 insertions(+), 1003 deletions(-)
 create mode 100644 t/op/whereis.t
 rename t/op/{when.t => whereso.t} (53%)

diff --git a/MANIFEST b/MANIFEST
index 49ebbb873b..e0f01b906a 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -5806,7 +5806,8 @@ t/op/ver.tSee if v-strings and 
the %v format flag work
 t/op/waitpid.t S

[perl.git] branch blead updated. v5.27.6-133-g557714184d

2017-12-05 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/557714184de18964b954b2c00fa13127fd3f216a?hp=3c0dbbbaeb55e36a6beabd1cfc9f0432053bcaf0>

- Log -
commit 557714184de18964b954b2c00fa13127fd3f216a
Author: Zefram <zef...@fysh.org>
Date:   Tue Dec 5 20:51:19 2017 +

document hash/block disambig in perlsyn

Fixes [perl #130958].

---

Summary of changes:
 pod/perlsyn.pod | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/pod/perlsyn.pod b/pod/perlsyn.pod
index efe4a26fc3..f5a2f2a92a 100644
--- a/pod/perlsyn.pod
+++ b/pod/perlsyn.pod
@@ -233,8 +233,16 @@ Sometimes a block is delimited by the file containing it 
(in the case
 of a required file, or the program as a whole), and sometimes a block
 is delimited by the extent of a string (in the case of an eval).
 
-But generally, a block is delimited by curly brackets, also known as braces.
-We will call this syntactic construct a BLOCK.
+But generally, a block is delimited by curly brackets, also known as
+braces.  We will call this syntactic construct a BLOCK.  Because enclosing
+braces are also the syntax for hash reference constructor expressions
+(see L), you may occasionally need to disambiguate by placing a
+C<;> immediately after an opening brace so that Perl realises the brace
+is the start of a block.  You will more frequently need to disambiguate
+the other way, by placing a C<+> immediately before an opening brace to
+force it to be interpreted as a hash reference constructor expression.
+It is considered good style to use these disambiguating mechanisms
+liberally, not only when Perl would otherwise guess incorrectly.
 
 The following compound statements may be used to control flow:
 

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-132-g3c0dbbbaeb

2017-12-05 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/3c0dbbbaeb55e36a6beabd1cfc9f0432053bcaf0?hp=7270698f29ae2f22f2cdfec7b156a75602cddf68>

- Log -
commit 3c0dbbbaeb55e36a6beabd1cfc9f0432053bcaf0
Author: Zefram <zef...@fysh.org>
Date:   Tue Dec 5 19:18:19 2017 +

correct and clarify doc of operator precedence

Fixes [perl #127391].

---

Summary of changes:
 pod/perlop.pod | 42 +++---
 1 file changed, 31 insertions(+), 11 deletions(-)

diff --git a/pod/perlop.pod b/pod/perlop.pod
index 785a9c9575..74a6a782e0 100644
--- a/pod/perlop.pod
+++ b/pod/perlop.pod
@@ -27,17 +27,37 @@ X<operator, precedence> X X
 Operator precedence and associativity work in Perl more or less like
 they do in mathematics.
 
-I means some operators are evaluated before
-others.  For example, in S<C<2 + 4 * 5>>, the multiplication has higher
-precedence so S<C<4 * 5>> is evaluated first yielding S<C<2 + 20 ==
-22>> and not S<C<6 * 5 == 30>>.
-
-I defines what happens if a sequence of the
-same operators is used one after another: whether the evaluator will
-evaluate the left operations first, or the right first.  For example, in
-S<C<8 - 4 - 2>>, subtraction is left associative so Perl evaluates the
-expression left to right.  S<C<8 - 4>> is evaluated first making the
-expression S<C<4 - 2 == 2>> and not S<C<8 - 2 == 6>>.
+I means some operators group more tightly than others.
+For example, in C<2 + 4 * 5>, the multiplication has higher precedence, so C<4
+* 5> is grouped together as the right-hand operand of the addition, rather
+than C<2 + 4> being grouped together as the left-hand operand of the
+multiplication. It is as if the expression were written C<2 + (4 * 5)>, not
+C<(2 + 4) * 5>. So the expression yields C<2 + 20 == 22>, rather than
+C<6 * 5 == 30>.
+
+I defines what happens if a sequence of the same
+operators is used one after another: whether they will be grouped at the left
+or the right. For example, in C<9 - 3 - 2>, subtraction is left associative,
+so C<9 - 3> is grouped together as the left-hand operand of the second
+subtraction, rather than C<3 - 2> being grouped together as the right-hand
+operand of the first subtraction. It is as if the expression were written
+C<(9 - 3) - 2>, not C<9 - (3 - 2)>. So the expression yields C<6 - 2 == 4>,
+rather than C<9 - 1 == 8>.
+
+For simple operators that evaluate all their operands and then combine the
+values in some way, precedence and associativity (and parentheses) imply some
+ordering requirements on those combining operations. For example, in C<2 + 4 *
+5>, the grouping implied by precedence means that the multiplication of 4 and
+5 must be performed before the addition of 2 and 20, simply because the result
+of that multiplication is required as one of the operands of the addition. But
+the order of operations is not fully determined by this: in C<2 * 2 + 4 * 5>
+both multiplications must be performed before the addition, but the grouping
+does not say anything about the order in which the two multiplications are
+performed. In fact Perl has a general rule that the operands of an operator
+are evaluated in left-to-right order. A few operators such as C<&&=> have
+special evaluation rules that can result in an operand not being evaluated at
+all; in general, the top-level operator in an expression has control of
+operand evaluation.
 
 Perl operators have the following associativity and precedence,
 listed from highest precedence to lowest.  Operators borrowed from

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-131-g7270698f29

2017-12-05 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/7270698f29ae2f22f2cdfec7b156a75602cddf68?hp=d3f0c815eccb54ae88550259c06aa395b2274580>

- Log -
commit 7270698f29ae2f22f2cdfec7b156a75602cddf68
Author: Zefram <zef...@fysh.org>
Date:   Tue Dec 5 18:08:51 2017 +

clarify conditions for calling DB::sub

The wording was ambiguous about which subroutine's compilation matters.
Fixes [perl #131672].

---

Summary of changes:
 pod/perldebguts.pod | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pod/perldebguts.pod b/pod/perldebguts.pod
index c463ff0315..a7257517ef 100644
--- a/pod/perldebguts.pod
+++ b/pod/perldebguts.pod
@@ -95,8 +95,8 @@ unless C<< $^D & (1<<30) >> is true.
 
 When execution of the program reaches a subroutine call, a call to
 C<::sub>(I) is made instead, with C<$DB::sub> holding the
-name of the called subroutine. (This doesn't happen if the subroutine
-was compiled in the C package.)
+name of the called subroutine. (This doesn't happen if the calling
+subroutine was compiled in the C package.)
 
 X<::lsub>If the call is to an lvalue subroutine, and C<::lsub>
 is defined C<::lsub>(I) is called instead, otherwise falling

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-130-gd3f0c815ec

2017-12-05 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/d3f0c815eccb54ae88550259c06aa395b2274580?hp=39dc9d148281a0a05168f216359b3bdb696fec66>

- Log -
commit d3f0c815eccb54ae88550259c06aa395b2274580
Author: Zefram <zef...@fysh.org>
Date:   Tue Dec 5 18:03:12 2017 +

remove doc hedge about autovivification

We're clear by now that we're not going to change the default
autovivification behaviour, so the documentation should no longer say
that it "may be fixed in a future release".  Fixes [perl #127712].

---

Summary of changes:
 pod/perlfunc.pod | 4 
 1 file changed, 4 deletions(-)

diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index e226c69764..1a7291dcf1 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -2486,10 +2486,6 @@ This happens anywhere the arrow operator is used, 
including even here:
 if (exists $ref->{"Some key"}){ }
 print $ref;  # prints HASH(0x80d3d5c)
 
-This surprising autovivification in what does not at first--or even
-second--glance appear to be an lvalue context may be fixed in a future
-release.
-
 Use of a subroutine call, rather than a subroutine name, as an argument
 to L<C|/exists EXPR> is an error.
 

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-129-g39dc9d1482

2017-12-05 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/39dc9d148281a0a05168f216359b3bdb696fec66?hp=1549f3837b17d2171a570cb54587ab8bd1eb5bb0>

- Log -
commit 39dc9d148281a0a05168f216359b3bdb696fec66
Author: Zefram <zef...@fysh.org>
Date:   Tue Dec 5 17:47:54 2017 +

document context provided by refgen

Fixes [perl #131061].

---

Summary of changes:
 pod/perlop.pod | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pod/perlop.pod b/pod/perlop.pod
index a4de37d561..785a9c9575 100644
--- a/pod/perlop.pod
+++ b/pod/perlop.pod
@@ -259,7 +259,12 @@ that would otherwise be interpreted as the complete list 
of function
 arguments.  (See examples above under L.)
 X<+>
 
-Unary C<"\"> creates a reference to whatever follows it.  See L
+Unary C<"\"> creates references.  If its operand is a single sigilled
+thing, it creates a reference to that object.  If its operand is a
+parenthesised list, then it creates references to the things mentioned
+in the list.  Otherwise it puts its operand in list context, and creates
+a list of references to the scalars in the list provided by the operand.
+See L
 and L.  Do not confuse this behavior with the behavior of
 backslash within a string, although both forms do convey the notion
 of protecting the next thing from interpolation.

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-127-g0740a29d60

2017-12-04 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/0740a29d60ebd4ff72090340b0140ec2210e90c7?hp=28ef70489d76deb9024de42a0571162f323148c8>

- Log -
commit 0740a29d60ebd4ff72090340b0140ec2210e90c7
Author: Zefram <zef...@fysh.org>
Date:   Tue Dec 5 06:13:27 2017 +

stop using _sv_yes as no-op method

Method lookup yields a fake method for ->import or ->unimport if there's
no actual method, for historical reasons so that "use" doesn't barf
if there's no import method.  This fake method used to be _sv_yes
being used as a magic placeholder, recognised specially by pp_entersub.
But _sv_yes is a string, which we'd expect to serve as a symbolic
CV ref.  Change method lookup to yield an actual CV with a body in this
case, and remove the special case from pp_entersub.  This fixes the
remaining part of [perl #126042].

---

Summary of changes:
 ext/XS-APItest/APItest.xs | 10 +-
 ext/XS-APItest/t/call.t   |  2 +-
 gv.c  |  7 ---
 pp_hot.c  | 10 --
 t/op/method.t | 47 +--
 t/op/sub.t| 26 +-
 6 files changed, 44 insertions(+), 58 deletions(-)

diff --git a/ext/XS-APItest/APItest.xs b/ext/XS-APItest/APItest.xs
index 5ceb7fe939..891b7e71d4 100644
--- a/ext/XS-APItest/APItest.xs
+++ b/ext/XS-APItest/APItest.xs
@@ -2339,9 +2339,17 @@ CODE:
only current internal behavior, these tests can be changed in the
future if necessery */
 PUSHMARK(SP);
-retcnt = call_sv(_sv_yes, 0); /* does nothing */
+retcnt = call_sv(_sv_yes, G_EVAL);
 SPAGAIN;
 SP -= retcnt;
+errsv = ERRSV;
+errstr = SvPV(errsv, errlen);
+if(memBEGINs(errstr, errlen, "Undefined subroutine ::1 called at")) {
+PUSHMARK(SP);
+retcnt = call_sv((SV*)i_sub, 0); /* call again to increase counter */
+SPAGAIN;
+SP -= retcnt;
+}
 PUSHMARK(SP);
 retcnt = call_sv(_sv_no, G_EVAL);
 SPAGAIN;
diff --git a/ext/XS-APItest/t/call.t b/ext/XS-APItest/t/call.t
index 355e49886e..8192b9bd36 100644
--- a/ext/XS-APItest/t/call.t
+++ b/ext/XS-APItest/t/call.t
@@ -33,7 +33,7 @@ sub i {
 $call_sv_count++;
 }
 call_sv_C();
-is($call_sv_count, 6, "call_sv_C passes");
+is($call_sv_count, 7, "call_sv_C passes");
 
 sub d {
 die "its_dead_jim\n";
diff --git a/gv.c b/gv.c
index bc5b388588..00adb8995c 100644
--- a/gv.c
+++ b/gv.c
@@ -1091,9 +1091,10 @@ Perl_gv_fetchmethod_pvn_flags(pTHX_ HV *stash, const 
char *name, const STRLEN le
/* This is the special case that exempts Foo->import and
   Foo->unimport from being an error even if there's no
  import/unimport subroutine */
-   if (strEQ(name,"import") || strEQ(name,"unimport"))
-   gv = MUTABLE_GV(_sv_yes);
-   else if (autoload)
+   if (strEQ(name,"import") || strEQ(name,"unimport")) {
+   gv = (GV*)sv_2mortal((SV*)newCONSTSUB_flags(NULL,
+   NULL, 0, 0, NULL));
+   } else if (autoload)
gv = gv_autoload_pvn(
ostash, name, name_end - name, GV_AUTOLOAD_ISMETHOD|flags
);
diff --git a/pp_hot.c b/pp_hot.c
index 7609638b8f..87e60970d6 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -5007,16 +5007,6 @@ PP(pp_entersub)
 if (UNLIKELY(!SvOK(sv)))
 DIE(aTHX_ PL_no_usym, "a subroutine");
 
-if (UNLIKELY(sv == _sv_yes)) { /* unfound import, ignore */
-if (PL_op->op_flags & OPf_STACKED) /* hasargs */
-SP = PL_stack_base + POPMARK;
-else
-(void)POPMARK;
-if (GIMME_V == G_SCALAR)
-PUSHs(_sv_undef);
-RETURN;
-}
-
 sym = SvPV_nomg_const(sv, len);
 if (PL_op->op_private & HINT_STRICT_REFS)
 DIE(aTHX_ "Can't use string (\"%" SVf32 "\"%s) as a 
subroutine ref while \"strict refs\" in use", sv, len>32 ? "..." : "");
diff --git a/t/op/method.t b/t/op/method.t
index 82f8263a10..d0fc321804 100644
--- a/t/op/method.t
+++ b/t/op/method.t
@@ -13,7 +13,35 @@ BEGIN {
 use strict;
 no warnings 'once';
 
-plan(tests => 151);
+plan(tests => 162);
+
+{
+# RT #126042 &{1==1} * &{1==1} would crash
+# There are two issues here.  Method lookup yields a fake method for
+# ->import or ->unimport if there's no actual method, for historical
+# reasons so that "use" doesn't barf if t

[perl.git] branch blead updated. v5.27.6-126-g28ef70489d

2017-12-04 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/28ef70489d76deb9024de42a0571162f323148c8?hp=76b35304cf4800e9e0f7b370b9f1f40bc6cfb7e0>

- Log -
commit 28ef70489d76deb9024de42a0571162f323148c8
Author: Zefram <zef...@fysh.org>
Date:   Tue Dec 5 03:05:51 2017 +

document newATTRSUB_x()

commit a59b17fa6324328a12a1d86a5e187e07ba8cee6c
Author: Zefram <zef...@fysh.org>
Date:   Tue Dec 5 00:02:10 2017 +

more fully document newCONSTSUB{,_flags}()

commit 68cd13c6081a23a59561d3289dba5a99f73c1463
Author: Zefram <zef...@fysh.org>
Date:   Mon Dec 4 22:44:07 2017 +

document newXS_len_flags()

commit 8bfeb7823012732f6bfd9c65485ae3ad9c0cce8d
Author: Zefram <zef...@fysh.org>
Date:   Mon Dec 4 17:13:08 2017 +

avoid attaching prototype to freed XS sub

XS sub creation in newXS_len_flags() was applying the prototype after
process_special_blocks(), which could free the sub if it's a BEGIN.
Track whether that's freed the sub, in the same way that newATTRSUB_x()
does, and skip adding the prototype if it's been freed.  Also sprinkle
some assertions throughout sub building code, about the sub being live.

This arises from [perl #125806], and prevents the immediate cause of its
segv, but doesn't actually fix it.  The test case there still fails, a bit
later on in newCONSTSUB_flags(), now hitting one of the new assertions.

---

Summary of changes:
 embed.fnc |   4 +-
 op.c  | 255 +-
 2 files changed, 239 insertions(+), 20 deletions(-)

diff --git a/embed.fnc b/embed.fnc
index d174290aae..a1678ec2c3 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -1114,7 +1114,7 @@ ApdR  |OP*|newSLICEOP |I32 flags|NULLOK OP* 
subscript|NULLOK OP* listop
 ApdR   |OP*|newSTATEOP |I32 flags|NULLOK char* label|NULLOK OP* o
 Apbm   |CV*|newSUB |I32 floor|NULLOK OP* o|NULLOK OP* proto \
|NULLOK OP* block
-p  |CV *   |newXS_len_flags|NULLOK const char *name|STRLEN len \
+pd |CV *   |newXS_len_flags|NULLOK const char *name|STRLEN len \
|NN XSUBADDR_t subaddr\
|NULLOK const char *const filename \
|NULLOK const char *const proto \
@@ -1995,7 +1995,7 @@ AnpMd |SV*|sv_get_backrefs|NN SV *const sv
 p  |int|magic_killbackrefs|NN SV *sv|NN MAGIC *mg
 Ap |OP*|newANONATTRSUB |I32 floor|NULLOK OP *proto|NULLOK OP 
*attrs|NULLOK OP *block
 Am |CV*|newATTRSUB |I32 floor|NULLOK OP *o|NULLOK OP *proto|NULLOK 
OP *attrs|NULLOK OP *block
-pX |CV*|newATTRSUB_x   |I32 floor|NULLOK OP *o|NULLOK OP *proto \
+pdX|CV*|newATTRSUB_x   |I32 floor|NULLOK OP *o|NULLOK OP *proto \
 |NULLOK OP *attrs|NULLOK OP *block \
 |bool o_is_gv
 Ap |CV *   |newMYSUB   |I32 floor|NN OP *o|NULLOK OP *proto \
diff --git a/op.c b/op.c
index 7d0185f650..072d3ceb53 100644
--- a/op.c
+++ b/op.c
@@ -9602,6 +9602,85 @@ Perl_newMYSUB(pTHX_ I32 floor, OP *o, OP *proto, OP 
*attrs, OP *block)
 return cv;
 }
 
+/*
+=for apidoc m|CV *|newATTRSUB_x|I32 floor|OP *o|OP *proto|OP *attrs|OP 
*block|bool o_is_gv
+
+Construct a Perl subroutine, also performing some surrounding jobs.
+
+This function is expected to be called in a Perl compilation context,
+and some aspects of the subroutine are taken from global variables
+associated with compilation.  In particular, C represents
+the subroutine that is currently being compiled.  It must be non-null
+when this function is called, and some aspects of the subroutine being
+constructed are taken from it.  The constructed subroutine may actually
+be a reuse of the C object, but will not necessarily be so.
+
+If C is null then the subroutine will have no body, and for the
+time being it will be an error to call it.  This represents a forward
+subroutine declaration such as S<C>.  If C is
+non-null then it provides the Perl code of the subroutine body, which
+will be executed when the subroutine is called.  This body includes
+any argument unwrapping code resulting from a subroutine signature or
+similar.  The pad use of the code must correspond to the pad attached
+to C.  The code is not expected to include a C or
+C op; this function will add such an op.  C is consumed
+by this function and will become part of the constructed subroutine.
+
+C specifies the subroutine's prototype, unless one is supplied
+as an attribute (see below).  If C is null, then the subroutine
+will not have a prototype.  If C is non-null, it must point to a
+C op whose value is a string, and the subroutine will have that
+string as its prototype.  If a p

[perl.git] branch blead updated. v5.27.6-108-gabda9fe0fe

2017-12-01 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/abda9fe0fe75ae824723761c1c98af958f17a41c?hp=3c67ad9b9e6d659feb76f3acfc9f81cfe59e3660>

- Log -
commit abda9fe0fe75ae824723761c1c98af958f17a41c
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 1 17:35:35 2017 +

in Data-Dumper, quote glob names better

Glob name quoting should obey Useqq.  Fixes [perl #119831].

---

Summary of changes:
 dist/Data-Dumper/Dumper.pm  |  8 
 dist/Data-Dumper/Dumper.xs  | 22 +++---
 dist/Data-Dumper/t/dumper.t | 35 ++-
 3 files changed, 45 insertions(+), 20 deletions(-)

diff --git a/dist/Data-Dumper/Dumper.pm b/dist/Data-Dumper/Dumper.pm
index 8e24a014aa..441e97329e 100644
--- a/dist/Data-Dumper/Dumper.pm
+++ b/dist/Data-Dumper/Dumper.pm
@@ -10,7 +10,7 @@
 package Data::Dumper;
 
 BEGIN {
-$VERSION = '2.167_02'; # Don't forget to set version and release
+$VERSION = '2.168'; # Don't forget to set version and release
 }   # date in POD below!
 
 #$| = 1;
@@ -536,8 +536,8 @@ sub _dump {
 $ref = \$val;
 if (ref($ref) eq 'GLOB') {  # glob
   my $name = substr($val, 1);
-  if ($name =~ /^[A-Za-z_][\w:]*$/ && $name ne 'main::') {
-$name =~ s/^main::/::/;
+  $name =~ s/^main::(?!\z)/::/;
+  if ($name =~ 
/\A(?:[A-Z_a-z][0-9A-Z_a-z]*)?::(?:[0-9A-Z_a-z]+::)*[0-9A-Z_a-z]*\z/ && $name 
ne 'main::') {
 $sname = $name;
   }
   else {
@@ -1474,7 +1474,7 @@ modify it under the same terms as Perl itself.
 
 =head1 VERSION
 
-Version 2.167_02
+Version 2.168
 
 =head1 SEE ALSO
 
diff --git a/dist/Data-Dumper/Dumper.xs b/dist/Data-Dumper/Dumper.xs
index 7de87ec7eb..895838ac6b 100644
--- a/dist/Data-Dumper/Dumper.xs
+++ b/dist/Data-Dumper/Dumper.xs
@@ -1300,29 +1300,21 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN 
namelen, SV *retval, HV *seenhv,
i = 0; else i -= 4;
}
 if (globname_needs_quote(c,i)) {
-#ifdef GvNAMEUTF8
- if (GvNAMEUTF8(val)) {
sv_grow(retval, SvCUR(retval)+2);
r = SvPVX(retval)+SvCUR(retval);
r[0] = '*'; r[1] = '{';
SvCUR_set(retval, SvCUR(retval)+2);
-esc_q_utf8(aTHX_ retval, c, i, 1, style->useqq);
+esc_q_utf8(aTHX_ retval, c, i,
+#ifdef GvNAMEUTF8
+   !!GvNAMEUTF8(val)
+#else
+   0
+#endif
+   , style->useqq);
sv_grow(retval, SvCUR(retval)+2);
r = SvPVX(retval)+SvCUR(retval);
r[0] = '}'; r[1] = '\0';
i = 1;
- }
- else
-#endif
- {
-   sv_grow(retval, SvCUR(retval)+6+2*i);
-   r = SvPVX(retval)+SvCUR(retval);
-   r[0] = '*'; r[1] = '{'; r[2] = '\'';
-   i += esc_q(r+3, c, i);
-   i += 3;
-   r[i++] = '\''; r[i++] = '}';
-   r[i] = '\0';
- }
}
else {
sv_grow(retval, SvCUR(retval)+i+2);
diff --git a/dist/Data-Dumper/t/dumper.t b/dist/Data-Dumper/t/dumper.t
index 643160a1c3..0c12f349e3 100644
--- a/dist/Data-Dumper/t/dumper.t
+++ b/dist/Data-Dumper/t/dumper.t
@@ -108,7 +108,7 @@ sub SKIP_TEST {
   ++$TNUM; print "ok $TNUM # skip $reason\n";
 }
 
-$TMAX = 450;
+$TMAX = 456;
 
 # Force Data::Dumper::Dump to use perl. We test Dumpxs explicitly by calling
 # it direct. Out here it lets us knobble the next if to test that the perl
@@ -1740,3 +1740,36 @@ EOT
 TEST (qq(Dumper("\n")), '\n alone');
 TEST (qq(Data::Dumper::DumperX("\n")), '\n alone') if $XS;
 }
+#
+our @globs = map { $_, \$_ } map { *$_ } map { $_, "s::$_" }
+   "foo", "\1bar", "L\x{e9}on", "m\x{100}cron", "snow\x{2603}";
+$WANT = <<'EOT';
+#$globs = [
+#  *::foo,
+#  \*::foo,
+#  *s::foo,
+#  \*s::foo,
+#  *{"::\1bar"},
+#  \*{"::\1bar"},
+#  *{"s::\1bar"},
+#  \*{"s::\1bar"},
+#  *{"::L\351on"},
+#  \*{"::L\351on"},
+#  *{"s::L\351on"},
+#  \*{"s::L\351on"},
+#  *{"::m\x{100}cron"},
+#  \*{"::m\x{100}cron"},
+#  *{"s::m\x{100}cron"},
+#  \*{"s::m\x{100}cron"},
+#  *{"::snow\x{2603}"},
+#  \*{"::snow\x{2603}"},
+#  *{"s::snow\x{2603}"},
+#  \*{"s::snow\x{2603}"}
+#];
+EOT
+{
+  local $Data::Dumper::Useqq = 1;
+  TEST (q(Data::Dumper->Dump([\@globs], ["globs"])), 'globs: Dump()');
+  TEST (q(Data::Dumper->Dumpxs([\@globs], ["globs"])), 'globs: Dumpxs()')
+if $XS;
+}

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-106-g7b9d2ba3d0

2017-11-30 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/7b9d2ba3d09352167d77ea97c7857509f147ef49?hp=009165e9970c3fcc3a252874e1ed96b1733976ea>

- Log -
commit 7b9d2ba3d09352167d77ea97c7857509f147ef49
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 1 02:10:33 2017 +

correct a perldelta description

The threshold for size computation problems in malloc() is a bit smaller
than the description initially indicated.

---

Summary of changes:
 pod/perldelta.pod | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 7f60cc4193..3c11d1a013 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -381,7 +381,7 @@ XXX
 =item *
 
 Perl's own C no longer gets confused by attempts to allocate
-more than 4 GiB on a 64-bit platform.  [perl #119829]
+more than a gigabyte on a 64-bit platform.  [perl #119829]
 
 =back
 

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-105-g009165e997

2017-11-30 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/009165e9970c3fcc3a252874e1ed96b1733976ea?hp=64072da0d64f4e24d5d3f53f391a1fb7a5121ac0>

- Log -
commit 009165e9970c3fcc3a252874e1ed96b1733976ea
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 1 01:39:57 2017 +

revert changes to st_ino signedness handling

This reverts commits 8843856e9716655549cce789b3338e1d4c72fffb,
3676f9e77d46b61f4785aad171f02bed29df0c07, and
793c2ded15ca832d1df1fabbc3b2e7562a057697.

As noted in the large comment above the relevant code, the probed
ST_INO_SIGN is not reliable enough for its purpose, because Configure
makes guesses.  The actual compiler knows whether st_ino is signed,
and is perfectly capable of optimising out the negative-handling code
in the usual case that st_ino is unsigned, without any need for us to
preprocess it away.

---

Summary of changes:
 pp_sys.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/pp_sys.c b/pp_sys.c
index 30b373bd3a..7a4c4ab1ef 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3012,13 +3012,14 @@ PP(pp_stat)
 * st_ino; and (d) sprintf() doesn't necessarily support
 * integers as large as st_ino.
 */
+   bool neg;
Stat_t s;
CLANG_DIAG_IGNORE(-Wtautological-compare);
GCC_DIAG_IGNORE(-Wtype-limits);
+   neg = PL_statcache.st_ino < 0;
GCC_DIAG_RESTORE;
CLANG_DIAG_RESTORE;
-#if ST_INO_SIGN == -1
-   if (PL_statcache.st_ino < 0) {
+   if (neg) {
s.st_ino = (IV)PL_statcache.st_ino;
if (LIKELY(s.st_ino == PL_statcache.st_ino)) {
mPUSHi(s.st_ino);
@@ -3036,9 +3037,7 @@ PP(pp_stat)
*--p = '-';
mPUSHp(p, buf+sizeof(buf) - p);
}
-   } else
-#endif
-{
+   } else {
s.st_ino = (UV)PL_statcache.st_ino;
if (LIKELY(s.st_ino == PL_statcache.st_ino)) {
mPUSHu(s.st_ino);

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.6-104-g64072da0d6

2017-11-30 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/64072da0d64f4e24d5d3f53f391a1fb7a5121ac0?hp=21baa9a2e2a9246add77c46706383cc1ccb9>

- Log -
commit 64072da0d64f4e24d5d3f53f391a1fb7a5121ac0
Author: Zefram <zef...@fysh.org>
Date:   Fri Dec 1 01:25:52 2017 +

in malloc, compute memory sizes in size_t

Some size computations were using the wrong data type, in particular
getting a signed 32-bit type where unsigned 64-bit is required on
LP64 systems.  That resulted in truncation and in sign extension during
later conversion to the correct type, either way producing bogus sizes.
Fix by casting everything to size_t suitably early.  Fixes [perl #119829].

---

Summary of changes:
 malloc.c  | 12 ++--
 pod/perldelta.pod |  5 +
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/malloc.c b/malloc.c
index bb72cddef1..53835e1f47 100644
--- a/malloc.c
+++ b/malloc.c
@@ -466,12 +466,12 @@ static const u_short buck_size[MAX_BUCKET_BY_TABLE + 1] =
   };
 #  define BUCKET_SIZE_NO_SURPLUS(i) ((i) % 2 ? buck_size[i] : (1 << ((i) >> 
BUCKET_POW2_SHIFT)))
 #  define BUCKET_SIZE_REAL(i) ((i) <= MAX_BUCKET_BY_TABLE  \
-  ? buck_size[i]   \
-  : ((1 << ((i) >> BUCKET_POW2_SHIFT)) \
+  ? ((size_t)buck_size[i]) \
+  : size_t)1) << ((i) >> BUCKET_POW2_SHIFT)) \
  - MEM_OVERHEAD(i) \
  + POW2_OPTIMIZE_SURPLUS(i)))
 #else
-#  define BUCKET_SIZE_NO_SURPLUS(i) (1 << ((i) >> BUCKET_POW2_SHIFT))
+#  define BUCKET_SIZE_NO_SURPLUS(i) (((size_t)1) << ((i) >> BUCKET_POW2_SHIFT))
 #  define BUCKET_SIZE(i) (BUCKET_SIZE_NO_SURPLUS(i) + POW2_OPTIMIZE_SURPLUS(i))
 #  define BUCKET_SIZE_REAL(i) (BUCKET_SIZE(i) - MEM_OVERHEAD(i))
 #endif 
@@ -686,7 +686,7 @@ static const u_short blk_shift[LOG_OF_MIN_ARENA * 
BUCKETS_PER_POW2] =
 
 #ifdef PACK_MALLOC
 #  define MEM_OVERHEAD(bucket) \
-  (bucket <= MAX_PACKED ? 0 : M_OVERHEAD)
+  (bucket <= MAX_PACKED ? ((size_t)0) : M_OVERHEAD)
 #  ifdef SMALL_BUCKET_VIA_TABLE
 #define START_SHIFTS_BUCKET ((MAX_PACKED_POW2 + 1) * BUCKETS_PER_POW2)
 #define START_SHIFT MAX_PACKED_POW2
@@ -752,11 +752,11 @@ static const char bucket_of[] =
 #  define POW2_OPTIMIZE_ADJUST(nbytes) \
((nbytes >= FIRST_BIG_BOUND) ? nbytes -= PERL_PAGESIZE : 0)
 #  define POW2_OPTIMIZE_SURPLUS(bucket)\
-   ((bucket >= FIRST_BIG_POW2 * BUCKETS_PER_POW2) ? PERL_PAGESIZE : 0)
+   ((size_t)((bucket >= FIRST_BIG_POW2 * BUCKETS_PER_POW2) ? PERL_PAGESIZE : 
0))
 
 #else  /* !TWO_POT_OPTIMIZE */
 #  define POW2_OPTIMIZE_ADJUST(nbytes)
-#  define POW2_OPTIMIZE_SURPLUS(bucket) 0
+#  define POW2_OPTIMIZE_SURPLUS(bucket) ((size_t)0)
 #endif /* !TWO_POT_OPTIMIZE */
 
 #define BARK_64K_LIMIT(what,nbytes,size)
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index b280c77420..7f60cc4193 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -378,6 +378,11 @@ files in F and F are best summarized in 
L.
 
 XXX
 
+=item *
+
+Perl's own C no longer gets confused by attempts to allocate
+more than 4 GiB on a 64-bit platform.  [perl #119829]
+
 =back
 
 =head1 Known Problems

-- 
Perl5 Master Repository


[perl.git] branch zefram/dumb_match updated. v5.27.6-42-gb1a6328e96

2017-11-29 Thread Zefram
In perl.git, the branch zefram/dumb_match has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/b1a6328e96a123f6ca713df406f01c2f4a2f2b7b?hp=9e0909b2180c408354ce24b6c742f4b79e783d11>

- Log -
commit b1a6328e96a123f6ca713df406f01c2f4a2f2b7b
Author: Zefram <zef...@fysh.org>
Date:   Wed Nov 29 22:02:58 2017 +

perldelta for more switch changes

commit e98c3eae7b9c9628400af33f6ac77a6feebb4f3f
Author: Zefram <zef...@fysh.org>
Date:   Wed Nov 29 21:51:11 2017 +

remove unused CXp_FOR_DEF and OPpITER_DEF

These were used to identify foreach loops that qualify as topicalizers.
That's no longer a relevant classification.

commit b4904f80ff3e727173a3d8a9856827695e1af0ad
Author: Zefram <zef...@fysh.org>
Date:   Wed Nov 29 21:44:37 2017 +

make "when" do implicit "next"

A "when" construct, upon reaching the end of its conditionally-executed
block, used to perform an implicit jump to the end of the enclosing
topicalizer, defined as either a "given" block or a "foreach" operating
on $_.  Change it to jump to the enclosing loop of any kind (which now
includes "given" blocks).

commit 97b4caa610942fa2caded4f8ec03ac72089cd30e
Author: Zefram <zef...@fysh.org>
Date:   Wed Nov 29 20:19:20 2017 +

remove useless "break" mechanism

commit 619bbb9ab0f3cffda05f980b2ebb5bf660ad6962
Author: Zefram <zef...@fysh.org>
Date:   Wed Nov 29 19:27:49 2017 +

make loop control apply to "given"

A "given" construct is now officially a one-iteration loop.

commit df16d5564aa82a94953a0bccfc9917bc140ead02
Author: Zefram <zef...@fysh.org>
Date:   Wed Nov 29 15:22:49 2017 +

revise block_givwhen for sole use by "when"

This context frame type doesn't need to cater for "given" any more.

commit df9e1bc13efe0941735d662db5683d62b3851535
Author: Zefram <zef...@fysh.org>
Date:   Wed Nov 29 14:12:51 2017 +

use blk_loop format for CXt_GIVEN

commit af8bd34d16b94bde32535062ba4e88407be233a0
Author: Zefram <zef...@fysh.org>
Date:   Wed Nov 29 00:13:38 2017 +

use LOOP struct for entergiven op

This will support the upcoming change to let loop control ops apply to
"given" blocks.

commit 5086635a9f7a492b5a0c6228ecf7a22abbabeef6
Author: Zefram <zef...@fysh.org>
Date:   Tue Nov 28 20:26:07 2017 +

avoid gratuitous given/when in test

commit 869b8c119a7436d3373e1325925a8b753d0e7805
Author: Zefram <zef...@fysh.org>
Date:   Tue Nov 28 20:21:36 2017 +

remove useless "default" mechanism

---

Summary of changes:
 cop.h |   22 +-
 cpan/experimental/t/basic.t   |4 +-
 dump.c|2 +-
 embed.fnc |8 +-
 embed.h   |5 +-
 ext/B/B.pm|2 +-
 ext/B/t/f_map.t   |4 +-
 ext/B/t/optree_samples.t  |   20 +-
 ext/Opcode/Opcode.pm  |4 +-
 ext/Pod-Functions/Functions_pm.PL |2 +-
 ext/Pod-Functions/t/Functions.t   |2 +-
 ext/XS-APItest/t/grok.t   |   25 +-
 gv.c  |2 +-
 inline.h  |   37 +-
 keywords.c|   72 +-
 keywords.h|  466 ++-
 lib/B/Deparse-core.t  |3 +-
 lib/B/Deparse.pm  |   19 +-
 lib/B/Deparse.t   |   24 +-
 lib/B/Op_private.pm   |5 -
 op.c  |  111 +--
 op.h  |2 -
 opcode.h  |  239 +++---
 opnames.h |  353 
 perly.act |  712 
 perly.h   |   91 +--
 perly.tab | 1638 ++---
 perly.y   |4 +-
 pod/perldelta.pod |   12 +
 pod/perldiag.pod  |   36 +-
 pod/perlfunc.pod  |   48 +-
 pod/perlsyn.pod   |   54 +-
 pp_ctl.c  |   94 +--
 pp_proto.h|1 -
 proto.h   |   23 +-
 regen/keywords.pl |4 -
 regen/op_private  |1 -
 regen/opcodes |3 +-
 scope.c   |4 +-
 sv.c  |5 +-
 t/lib/croak/pp_ctl|8 +-
 t/lib/feature/switch  |   64 --
 t/op/coreamp.t|   12 -
 t/op/cproto.t |4 +-
 t/op/given.t  |  106 ++-
 t/op/state.t

[perl.git] branch blead updated. v5.27.6-56-gbb02b572f9

2017-11-26 Thread Zefram
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/bb02b572f9a36976b622aca31b9f0f2bb2929e48?hp=80c72aa9ab6134a852bea9edb1282bafafbc671b>

- Log -
commit bb02b572f9a36976b622aca31b9f0f2bb2929e48
Author: Zefram <zef...@fysh.org>
Date:   Sun Nov 26 18:20:10 2017 +

expect -k to be overloadable on Win32

Since commit a6c31837e629c46be2f7496149b36a4b79f93484, the -k filetest
operator works more coherently on Win32, in that it now stats the
requested file and only returns a non-error false result for an extant
file.  This makes it respect string overloading on its argument, which
was previously ignored.  A test of string overloading for filetests
was expecting string overloading to be ignored for -k on Win32, and now
needs to have no such exception.

---

Summary of changes:
 t/op/filetest.t | 16 
 1 file changed, 16 deletions(-)

diff --git a/t/op/filetest.t b/t/op/filetest.t
index bd1d08c298..fe9724c59a 100644
--- a/t/op/filetest.t
+++ b/t/op/filetest.t
@@ -222,22 +222,6 @@ for my $op (split //, "rwxoRWXOezsfdlpSbctugkTMBAC") {
 is( $rv,"-$op", "correct return value for overloaded 
-$op");
 
 my ($exp, $is) = (1, "is");
-if (
-   (
- !$fcntl_not_available and
- (
-   $op eq "u" and not eval { Fcntl::S_ISUID() } or
-   $op eq "g" and not eval { Fcntl::S_ISGID() } or
-   $op eq "k" and not eval { Fcntl::S_ISVTX() }
- )
-   )
-   ||
-   # the Fcntl test is meaningless in miniperl and
-   # S_ISVTX isn't available on Win32
-   ( $^O eq 'MSWin32' && $op eq 'k' && is_miniperl )
-) {
-($exp, $is) = (0, "not");
-}
 
 $over = 0;
 $rv = eval "-$op \$str";

-- 
Perl5 Master Repository


[perl.git] branch zefram/dumb_match created. v5.27.6-32-g9e0909b218

2017-11-22 Thread Zefram
In perl.git, the branch zefram/dumb_match has been created

<https://perl5.git.perl.org/perl.git/commitdiff/9e0909b2180c408354ce24b6c742f4b79e783d11?hp=>

at  9e0909b2180c408354ce24b6c742f4b79e783d11 (commit)

- Log -
commit 9e0909b2180c408354ce24b6c742f4b79e783d11
Author: Zefram <zef...@fysh.org>
Date:   Wed Nov 22 19:13:51 2017 +

perldelta for smartmatch changes

commit fb24bb2d5fb05aef6336a32777331137e881eff5
Author: Zefram <zef...@fysh.org>
Date:   Wed Nov 22 18:47:40 2017 +

test $swap arg for smartmatch overload

commit 1068631d8485410b2f8645d5413bbed47244a4a8
Author: Zefram <zef...@fysh.org>
Date:   Wed Nov 22 18:24:43 2017 +

update doc in lib/ about smartmatch

commit 25233fb4d503834fd10cefc6b551240224a7f31a
Author: Zefram <zef...@fysh.org>
Date:   Wed Nov 22 18:08:06 2017 +

canonicalise smartmatch overload truth values

This enforces that a smartmatch overload returns just a truth value
indicating whether the lhs matches the criterion, not some more complex
kind of result that doesn't fit the smartmatch concept.

commit ab179ac766f9eda4c7f539d09c43b02b45938b5c
Author: Zefram <zef...@fysh.org>
Date:   Wed Nov 22 17:57:26 2017 +

drop op flag for implicit smartmatch

OPf_SPECIAL on a smartmatch op used to indicate that it was an implicit
smartmatch in a "when" construct.  "when" no longer implies smartmatch, so
drop the comment about this flag and the special handling in B::Deparse.

commit 8a0ed425bf56098485707c69bba62ee2404bef3f
Author: Zefram <zef...@fysh.org>
Date:   Wed Nov 22 17:51:21 2017 +

test details of smartmatch overloading

Test that an exception in a smartmatch overload is propagated out of
the smartmatch operation.  Test that a smartmatch overload is called
in scalar context for a scalar or list context smartmatch, and in void
context for a void context smartmatch.

commit e32748c9f33b07135a5e2e4f1cdcdf22cd3a93ad
Author: Zefram <zef...@fysh.org>
Date:   Wed Nov 22 17:38:42 2017 +

remove now-unused "M" debugging flag

commit 5f3202fa3e77c4a20de590df045af4683aaedffa
Author: Zefram <zef...@fysh.org>
Date:   Wed Nov 22 17:23:57 2017 +

eviscerate smartmatch

Regularise smartmatch's operand handling, by removing the implicit
enreferencement and just supplying scalar context.  Eviscerate its runtime
behaviour, by removing all the matching rules other than rhs overloading.
Overload smartmatching in the Regexp package to perform regexp matching.

There are consequential customisations to autodie, in two areas.  Firstly,
autodie::exception objects are matchers, but autodie has been advising
smartmatching with the exception on the lhs.  This has to change to the
rhs, in both documentation and tests.  Secondly, it uses smartmatching as
part of its hint mechanism.  Most of the hint examples, in documentation
and tests, have to change to subroutines, to be portable across Perl
versions.

commit 5e1cca32ac612f0b59508a99fbff671a693f39b9
Author: Zefram <zef...@fysh.org>
Date:   Wed Nov 22 17:16:36 2017 +

update perlexperiment.pod re smartmatch

Mention the big changes in 5.28, and explicate that the experiment covers
    switch as well as smartmatch.

commit 98729e54e4bb1f6f9e5e0a21c6e56461abe54dbf
Author: Zefram <zef...@fysh.org>
Date:   Tue Nov 21 20:13:03 2017 +

revise all given/when documentation

Update documentation that describes old behaviour of given/when (of
various vintages) as current.  Remove duplication.  Edit the main section
in perlsyn for clarity.  Properly document details of "break".

commit 64805db9f7c4784f6ddf4f97dcbe6fd820f05a45
Author: Zefram <zef...@fysh.org>
Date:   Tue Nov 21 18:47:09 2017 +

merge switch sections in perlsyn.pod

Now that the biggest parts of the "Experimental Details on given and
when" are gone, merge the remaining part of the section into the "Switch
Statements" section.

commit 1c71ec5e58384a564f5eb9864d03334aa772afcc
Author: Zefram <zef...@fysh.org>
Date:   Tue Nov 21 18:28:31 2017 +

remove unused arg from newGIVWHENOP()

The entertarg argument hasn't been used for a long time.

commit b69ef0135bfebf0c32023bcb970dbb95957b32e7
Author: Zefram <zef...@fysh.org>
Date:   Tue Nov 21 18:17:10 2017 +

regularise "when"

Remove from "when" the implicit enreferencement of array/hash conditions
and the implicit smartmatch of most conditions.  Delete most of the
documentation about behaviour of older versions of given/when, because
explaining the now-old "when" behaviour would be excessively cumbersome

  1   2   3   >