Consider /... a directory component with EFS on VMS.

For some reason the omnibus patch (360732b5267d5dfe) that brought
Extended Filename Syntax support to the VMS port considered three
dots part of the filename portion rather than part of the
directory portion when converting a Unix-format path to VMS format.

There's no reason this should be different with EFS, so make it
the same as without EFS, which gets two TODO tests passing.
Remove 3 unused interpreter variables

These variables have been unused in the Perl core since
commit 4c88d5e0740d796bf5064336d280bba72897f385.

The variables are undocumented.  The only real use of any of these I
found in CPAN is at
https://metacpan.org/source/ABERGMAN/Devel-GC-Helper-0.25/Helper.xs#L1
The uses there appear to be in a list of known Perl variables.  Since
the module was published, more than a few new variables have been added,
making this code obsolete anyway.
regexec.c: White space only; no code changes
Fix comment referencing pp_iterinit (should be pp_enteriter)
New COW mechanism

This was discussed in ticket #114820.

This new copy-on-write mechanism stores a reference count for the
PV inside the PV itself, at the very end.  (I was using SvEND+1
at first, but parts of the regexp engine expect to be able to do
SvCUR_set(sv,0), which causes the wrong byte of the string to be used
as the reference count.)  Only 256 SVs can share the same PV this way.
Also, only strings with allocated space after the trailing null can
be used for copy-on-write.

Much of the code is shared with PERL_OLD_COPY_ON_WRITE.  The restric-
tion against doing copy-on-write with magical variables has hence been
inherited, though it is not necessary.  A future commit will take
care of that.

I had to modify _core_swash_init to handle $@ differently.  The exist-
ing mechanism of copying $@ to a new scalar and back again was very
fragile.  With copy-on-write, $@ =~ s/// can cause pp_subst’s string
pointers to become stale.  So now we remove the scalar from *@ and
allow the utf8-table-loading code to autovivify a new one.  Then we
restore the untouched $@ afterwards if all goes well.
Min string length for COW

We have two separate length thresholds for when copy-on-write kicks
in, one for when a buffer would have had to be (re)allocated
(SV_COW_THRESHOLD) and another for when there is already a large
enough buffer available (SV_COWBUF_THRESHOLD).

Benchmarking against mktables and against Test.Simple’s test suite
(see JS::Test::Simple on CPAN) run with WWW::Scripter and JE shows
that 0/1250 is the best combination, at least on 32-bit darwin.

Apparently, copying into an existing buffer is much faster than the
bookkeeping overhead of sv_force_normal_flags (which I see no way to
speed up).

I have defined these conditionally with #ifndef, so that platform-spe-
cific hints can override them with values appropriate to the platform.

Also, refactor things in sv_setsv_flags slightly to avoid using SvLEN
and SvCUR repeatedly.
Allow COW with magical and blessed scalars (among others)

Under PERL_NEW_COPY_ON_WRITE (and I suspect under
PERL_OLD_COPY_ON_WRITE, too, but have not confirmed) it is harmless to
do copy-on-write with a magical or blessed scalar.

Also, under PERL_NEW_COPY_ON_WRITE, it is safe to do copy-on-write
with scalars that have numbers in them as well as strings (though not
under PERL_OLD_COPY_ON_WRITE).

So redefine CAN_COW_MASK under PERL_NEW_COPY_ON_WRITE to be less
restrictive.  We still can’t do it when the SvOOK hack is in place,
and I don’t feel comfortable doing it with regexps, even if it could
be proven feasible (regexps are SVf_FAKE, so that covers them).

Anything SvROK cannot be SvPOK, so obviously we can’t COW with that,
but I left SVf_ROK in for good measure.

This change to CAN_COW_MASK affects whether non-cow scalars will be
turned into cows in sv_setsv_flags.  It is already possible for exist-
ing cows to become magical, blessed or numeric elsewhere.

Also, we don’t need to check the flags on the lhs in sv_setsv_flags,
except for SVf_BREAK.  This is similar to ecd5fa70f3, but applies to
another branch just below it.

pp_subst needs a little bit of adjustment, as it is not expecting a
vstring to turn into a cow.
Enable PERL_NEW_COPY_ON_WRITE by default

One can disable this with -Accflags=-DPERL_NO_COW.

I am leaving this in for debugging purposes.  If it causes no problems
in 5.18, we might remove the defines and enable it unconditionally in
5.20, but then again we might not.
Disable PL_sawampersand

PL_sawampersand actually causes bugs (e.g., perl #4289), because the
behaviour changes.  eval '$&' after a match will produce different
results depending on whether $& was seen before the match.

Using copy-on-write for the pre-match copy (preceding patches do that)
alleviates the slowdown caused by mentioning $&.  The copy doesn’t
happen unless the string is modified after the match.  It’s now a
post- match copy.  So we no longer need to do things differently
depending on whether $& has been seen.

PL_sawampersand is now #defined to be equal to what it would be if
every program began with $',$&,$`.

I left the PL_sawampersand code in place, in case this commit proves
immature.  Running Configure with -Accflags=PERL_SAWAMPERSAND will
reënable the PL_sawampersand mechanism.
perl.h: Mention PERL_SAWAMPERSAND in perl -V output
Fix up Peek.t to account for preceding commits
test_bootstrap.t: Skip PL_sawampersand tests

unless PERL_SAWAMPERSAND is defined.
Test perl #4289

This was fixed by the disabling of PL_sawampersand a few commits ago.

The output used to be like this:

$ perl -e '$_ = "abc"; /b/g; $_ = "hello"; print eval q|$&|, "\n"'
e
$ perl -e '$_ = "abc"; /b/g; $_ = "hello"; print eval q|$`|, "\n"'
h
$ perl -e '$_ = "abc"; /b/g; $_ = "hello"; print eval q|$'\''|, "\n"'
l

Now it’s like this:

$ ./perl -e '$_ = "abc"; /b/g; $_ = "hello"; print eval q|$&|, "\n"'
b
$ ./perl -e '$_ = "abc"; /b/g; $_ = "hello"; print eval q|$`|, "\n"'
a
$ ./perl -e '$_ = "abc"; /b/g; $_ = "hello"; print eval q|$'\''|, "\n"'
c
English.pm: Update -no_match_vars docs
Increase $English::VERSION to 1.06
Update docs to concur with $`,$&,$' changes

plus a couple of other pod tweaks.
subst.t: Test something I nearly broke

The saving and restoring of $@ when utf8 tables were looked up was
causing pp_subst’s string pointers to go stale.  The existing mechanism
of copying it temporarily to another scalar was already very fragile,
and the new COW mechanism broke it (but I fixed it in the same commit
that introduced the new COW mechanism).
Don’t share TARGs between recursive ops

I had to change the definition of IS_PADCONST to account for the
SVf_IsCOW flag.  Previously, anything marked READONLY would be consid-
ered a pad constant, to be shared by pads of different recursion lev-
els.  Some of those READONLY things were not actually read-only, as
they were copy-on-write scalars, which are never read-only.  So I
changed the definition of IS_PADCONST in e3918bb703c to accept COWs
as well as read-only scalars, since I was removing the READONLY flag
from COWs.

With the new copy-on-write scheme, it is easy for a TARG to turn into
a COW.  If that happens and then the same subroutine calls itself
recursively for the first time after that, pad_push will see that this
is a pad ‘constant’ and allow the next recursion level to share it.

If pp_concat calls itself recursively, the recursive call can modify
the scalar the outer call is in the middle of using, causing the
return value to be doubled up (‘tmptmp’) in the test case added here.

Since pad constants are marked PADTMP (I would like to change that
eventually), there is no way to distinguish them from TARGs when the
are COWs, except for the fact that pad constants that are COWs are
always shared hash keys (SvLEN==0).
[Merge] New COW mechanism

This branch makes string copying faster by introducing a new copy-on-
write mechanism.  A reference count for the string buffer is now
stored inside the string buffer itself.  This can be disabled with
-Accflags=-DPERL_NO_COW.

It also disables the PL_sawampersand mechanism, as copy-on-write
can now be used for the pre-match ‘copy’, resulting in no slow-
down from using $& and f(r)iends.  This can be reënabled with
-Accflags=-DPERL_SAWAMPERSAND.
perlapi: Don't mention internal function

This function is undocumented, and is for internal core use only.  Cause
it to not be mentioned in perlapi