perldelta updates
Update CPAN-Meta-YAML to CPAN version 0.011

  [DELTA]

0.011     2014-02-13 20:30:30-05:00 America/New_York

  - Generated from ETHER/YAML-Tiny-1.60.tar.gz
re_intuit_start(): fix SEGV in /^../m code

RT #121248

Part of my recent refactoring of the code in re_intuit_start() - the bit
that searches for \n's in /^../m patterns (d0880ea) - introduced a
segfault, due to the count arg of memchr() going negative.

This is due to the stclass code (which I haven't refactored yet)
incrementing rx_origin beyond the last point it could match, then jumping
back to the MBOL block. In theory the stclass block should be fixed, but
until I get round to that, I've just added a test to the MBOL block
instead.
Update Pod-Escapes to CPAN version 1.06

  [DELTA]

1.06 2014-02-14 NEILB

    - e2charnum() was using \d but should use [0-9].
      RT#70246 report and fix from MARCGREEN
    - Added a bunch of pod-related links to SEE ALSO
Remove a redundant EXTEND (its followed by XPUSHs)
sv.c: Don’t flip flags so many times in glob_assign_glob

We only need to turn off the SvOK flags when the destination was not
already a glob.

Up till now, the code was doing SvOK_off twice, and
isGV_with_GP_on/off several times to avoid assertion failures.

If we already have a glob, then the only SvOK flags that can be on
already are SVpgv_GP (which needs to be on) and possibly SVf_UTF8,
which is harmless.

The only difference is that now the dumped glob in this one-liner will
have its UTF8 flag set:

$ ./perl -Ilib -MDevel::Peek -e 'use utf8; "".*φου; *φου = *bar; Dump *φου'

whereas it didn’t before.  That is of no consequence, as the UTF8 flag
is only meaningful after stringification, which resets it.
AUTHORS formatting clean-up

• Consistent indentation
• Missing <> around e-mail address
[perl #121242] Fix crash in gp_free when gv is freed

Commit 4571f4a caused the gp to have a refcount of 1, not 0, in
gp_free when the contents of the glob are freed.  This makes
gv_try_downgrade see the gv as a candidate for downgrading in
this example:

sub Fred::AUTOLOAD { $Fred::AUTOLOAD }
undef *{"Fred::AUTOLOAD"};

When the glob is undefined, the sub inside it is freed, and the
gvop ($Fred::AUTOLOAD), when freed, tries to downgrade the glob
(*Fred::AUTOLOAD).  Since it is empty, it deletes it completely from
the containing stash, so the GV is freed out from under gp_free, which
is still using it, causing an assertion failure.

We can trigger a similar condition more explicitly:

$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = bless []; undef *{"foo"}'

This bug is nothing new.  On a non-debugging 5.18.2, I get this:

$ perl5.18.2 -e 'DESTROY{delete $::{foo}} ${"foo"} = bless []; undef *{"foo"}'
Attempt to free unreferenced glob pointers at -e line 1.
Segmentation fault: 11

That crashes in pp_undef after the call to gp_free, becaues pp_undef
continues to manipulate the GV.

The problem occurs not only with pp_undef, but also with other func-
tions calling gp_free:

sv_setsv_flags:
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = bless []; *{"foo"}="bar"'

glob_assign_glob:
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = bless []; *{"foo"}=*bar'

sv_unglob, reached through various paths:
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = do {local *bar}; $${"foo"} = bless []; ${"foo"} = 3'
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = do {local *bar}; $${"foo"} = bless []; utf8::encode(${"foo"})'
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = do {local *bar}; $${"foo"} = bless []; open bar, "t/TEST"; ${"foo"} .= <bar>'
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = do {local *bar}; $${"foo"} = bless []; ${"foo"}++'
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = do {local *bar}; $${"foo"} = bless []; undef ${"foo"}'
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = 3; ${"foo"} =~ s/3/${"foo"} = do {local *bar}; $${"foo"} = bless []; 4/e'

And there are probably more ways to trigger this through sv_unglob.
(I stopped looking when I thought of the fix.)

This patch fixes the problem by protecting the GV using the mortals
stack in functions that call gp_free.  I did not change gp_free
itself, since it is an API function that as yet does not touch the
mortals stack, and I am not sure that should change.  All of its
callers that this patch touches already do sv_2mortal in some cir-
cumstances.
t/test.pl: Add option to runperl to suppress STDERR
Emulate POSIX locale setting on Windows

Locale initialization and setting on Windows haven't been as
described in perllocale for setting locales to "".  This is because that
tells Windows to use the system default locale, as set through the
Control Panel, but on POSIX systems, it means to look at various
environment variables.

This commit creates a wrapper for setlocale, used only on Windows, that
looks for the appropriate environment variables when called with a ""
input locale.  If none are found, it continues to use the system default
locale.
locale.c: Add, move some comments, and a declaration

This adds some more comments at the beginning of a function concerning
its API, and moves them to before any declarations.

It also moves the declaration for 'done' to the block of other
declarations, and adds a PERL_UNUSED_VAR call if the code that uses it
is #ifdef'd out.  Previously it was too easy to not notice the
declaration separate from the others, and to insert code between the
two, which would not compile under C89, but only on Ultrix machines.
Improve fallback during locale initialization

If Perl encounters a problem during startup trying to initialize the
locales from the environment it has immediately reverted to the "C"
locale.

This commit generalizes that so it tries each of the applicable
environment variables in order of priority until it works, or it gives
up and uses the "C" locale.  For example, if LC_ALL is set to something
that is invalid, but LANG is valid, LANG will be used.  This was
motivated by trying to get the Windows system default locale used in
preference to "C" if all else fails.
locale.c: White-space, useless brace removal only

This takes one piece of code that is needlessly enclosed in braces and
removes the braces, outdenting and reflowing the comments.

Otherwise, it changes to correct indentation for the addition and
removal of braces by the previous commit.
Initialize LC_MESSAGES at start-up

The code did not explicitly iinitialize LC_MESSAGES at startup, unlike
most of the other standard categories; I don't know why.

This is only an issue for those few platforms without LC_ALL, as that is
initialized, and includes LC_MESSAGES.  This commit extends the proper
initialization to those other platforms.
Make sure LC_MONETARY is initialized

This is only an issue for those few platforms without LC_ALL, as that
is initialized, and includes LC_MONETARY.  This commit extends the
proper initialization to those other platforms.  Perl doesn't use
LC_MONETARY itself, but it should be properly initialized for modules
that do.
t/run/locale.t: Fix SKIP end position

On the platforms where this skip gets engaged, it would have skipped too
much
t/test.pl: Don't read uninitialized variable

Commit 97dffe50643dd18f87b33b7ec6f8b55bbfd1fd74 introduced
an attempt to access an unitialized hash value.
Deprecate uses of POSIX::isfoo()

These functions have been supplanted in more modern Perls by
/[[:posix:]]/.  The documentation has been wrong; they don't handle
UTF-8 and return true on an empty string.  Rather than try to fix them,
the decision has been made to deprecate them instead.

See http://markmail.org/thread/jhqcag5njmx7jpyu

This commit also updates the documentation to be accurate.
ext/POSIX/t/posix.t: White-space only

Indent into a newly formed block
ext/POSIX/POSIX.xs: Add comments

If these few lines are uncommented, the isfoo() functions will no longer
return TRUE for an empty string input.  Since we decided to deprecate
them, it will be unlikely that we do this, but I had written this before
that, and even though it's trivial, I think it better to potentially
save a little work .