This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
10 years agoCorrect typo in commit b38d7779bd
Steve Hay [Sat, 5 Apr 2014 17:18:43 +0000 (18:18 +0100)]
Correct typo in commit b38d7779bd

10 years agofix documentation of HeUTF8 return value
David Golden [Fri, 4 Apr 2014 16:00:52 +0000 (12:00 -0400)]
fix documentation of HeUTF8 return value

10 years agoperl5182delta typo fixes
Smylers [Wed, 2 Apr 2014 16:06:09 +0000 (17:06 +0100)]
perl5182delta typo fixes

Escaping fix.

Missing full stop added.

10 years agoRMG - Update note about adding new perldelta in BLEAD-FINAL/MAINT releases
Steve Hay [Fri, 4 Apr 2014 07:41:11 +0000 (08:41 +0100)]
RMG - Update note about adding new perldelta in BLEAD-FINAL/MAINT releases

10 years agoAdd pod/perl5182delta.pod
Steve Hay [Fri, 4 Apr 2014 07:39:15 +0000 (08:39 +0100)]
Add pod/perl5182delta.pod

10 years agoutf8: add tests for behavior change in v5.15.6-407-gc710240, and more
Ævar Arnfjörð Bjarmason [Wed, 2 Apr 2014 15:53:18 +0000 (15:53 +0000)]
utf8: add tests for behavior change in v5.15.6-407-gc710240, and more

In v5.15.6-407-gc710240 Father Chrysostomos patched utf8::decode() so it
would call SvPV_force_nolen() on its argument. This meant that calling
utf8::decode() with a non-blessed non-overloaded reference would now
coerce the reference scalar to a string, i.e. before we'd do:

    $ ./perl -Ilib -MDevel::Peek -wle 'use strict; print $]; my $s = shift; my $s_ref = \$s; utf8::decode($s_ref); Dump $s_ref; print $$s_ref' ævar
    5.019011
    SV = IV(0x2579fd8) at 0x2579fe8
      REFCNT = 1
      FLAGS = (PADMY,ROK)
      RV = 0x25c33d8
      SV = PV(0x257ab08) at 0x25c33d8
        REFCNT = 2
        FLAGS = (PADMY,POK,pPOK)
        PV = 0x25a1338 "\303\246var"\0
        CUR = 5
        LEN = 16
    ævar

But after calling SvPV_force_nolen(sv) we'd instead do:

    $ ./perl -Ilib -MDevel::Peek -wle 'use strict; print $]; my $s = shift; my $s_ref = \$s; utf8::decode($s_ref); Dump $s_ref; print $$s_ref' ævar
    5.019011
    SV = PVIV(0x140e4b8) at 0x13e7fe8
      REFCNT = 1
      FLAGS = (PADMY,POK,pPOK)
      IV = 0
      PV = 0x140c578 "SCALAR(0x14313d8)"\0
      CUR = 17
      LEN = 24
    Can't use string ("SCALAR(0x14313d8)") as a SCALAR ref while "strict refs" in use at -e line 1.

I think this is arguably the right thing to do, we wouln't actually utf8
decode the containing scalar so this reveals bugs in code that passed
references to utf8::decode(), what you want is to do this instead:

    $ ./perl -CO -Ilib -MDevel::Peek -wle 'use strict; print $]; my $s = shift; my $s_ref = \$s; utf8::decode($$s_ref); Dump $s_ref; print $$s_ref' ævar
    5.019011
    SV = IV(0x1aa8fd8) at 0x1aa8fe8
      REFCNT = 1
      FLAGS = (PADMY,ROK)
      RV = 0x1af23d8
      SV = PV(0x1aa9b08) at 0x1af23d8
        REFCNT = 2
        FLAGS = (PADMY,POK,pPOK,UTF8)
        PV = 0x1ad0338 "\303\246var"\0 [UTF8 "\x{e6}var"]
        CUR = 5
        LEN = 16
    ævar

However I think we should be more consistent here, e.g. we'll die when
utf8::upgrade() gets passed a reference, but utf8::downgrade() just
passes it through. I'll file a bug for that separately.

10 years agoFix comments and pod that mention 5.20 erroneously
Karl Williamson [Tue, 1 Apr 2014 23:21:48 +0000 (17:21 -0600)]
Fix comments and pod that mention 5.20 erroneously

In certain places in the documentation, "5.20" is no longer applicable.
Also, a message referred to in perldiag got reworded, but our checks did
not catch that perldiag should have been updated.

10 years agoAdjust conflicting documentation about \s vis-à-vis \cK
Thomas Sibley (via RT) [Tue, 1 Apr 2014 21:01:02 +0000 (14:01 -0700)]
Adjust conflicting documentation about \s vis-à-vis \cK

# New Ticket Created by  Thomas Sibley
# Please include the string:  [perl #121558]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=121558 >

See attached patch against blead.

>From 84a704858995060ef78a39372ca7e2572c6141a3 Mon Sep 17 00:00:00 2001
From: Thomas Sibley <tsibley@cpan.org>
Date: Tue, 1 Apr 2014 13:49:26 -0700
Subject: [PATCH] =?UTF-8?q?Adjust=20conflicting=20documentation=20about=20?=
 =?UTF-8?q?\s=20vis-=C3=A0-vis=20\cK?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

It makes little sense to say that \s matches \cK unconditionally in the
same sentence as saying it matches \cK conditionally (>= Perl 5.18).

I suppose the intention could have been to specify the full char class
in the documentation from 5.18 onwards while still noting when that
change happened (the introducing commit, d28d802, was only on 5.17+),
but the sentence structure and convention in the rest of the document
suggests otherwise.

10 years agoPATCH: [perl #119499] "$!" with UTF-8 flag
Karl Williamson [Mon, 31 Mar 2014 21:43:51 +0000 (15:43 -0600)]
PATCH: [perl #119499] "$!" with UTF-8 flag

This disables the code that sets the UTF-8 flag when "$!" is UTF-8.
This is being done to get v5.20 out the door, with changes to follow in
v5.21.  See towards the end of the discussion of this ticket.

Unfortunately this change will cause #112208 to no longer be fixed.

10 years agoPATCH: [perl 121317] Gconvert() obeys LC_NUMERIC without "use locale"
Karl Williamson [Mon, 31 Mar 2014 17:07:53 +0000 (11:07 -0600)]
PATCH: [perl 121317] Gconvert() obeys LC_NUMERIC without "use locale"

This reverts part of bc8ec7cc020d0562094a551b280fd3f32bf5eb04.
leaving LC_NUMERIC set to the C locale at start-up.  This allows the
tests for quite a few XS modules to pass, as they (and likely the
modules themselves) are expecting a dot as the decimal point character.
However,such modules remain vulnerable to explicit calls to setlocale()
by the Perl code or other modules,

See the ticket's discussion for ideas on how to fix this better in 5.21
going forward.

I did not add tests because this fix only affects XS code that is not in
the Perl API, and we don't have any infrastructure for testing that.
Building such infrastructure seems to me to be too much for the code
freeze situation we are in, and all this is planned to change very early
in v5.21 anyway.

10 years agoperllocale: Nits
Karl Williamson [Mon, 31 Mar 2014 21:33:01 +0000 (15:33 -0600)]
perllocale: Nits

The hyperlink text looks wrong in html

10 years agoperllocale: Note that $^E acts the same as $!
Karl Williamson [Mon, 31 Mar 2014 20:14:21 +0000 (14:14 -0600)]
perllocale: Note that $^E acts the same as $!

10 years agomg.c: Fix comment typo
Karl Williamson [Mon, 31 Mar 2014 16:09:22 +0000 (10:09 -0600)]
mg.c: Fix comment typo

10 years agomissing word in perl5200delta.pod
David Mitchell [Tue, 1 Apr 2014 14:36:56 +0000 (15:36 +0100)]
missing word in perl5200delta.pod

I missed out "will" in
1ffb44d62eaa2f08535ed009ec13d81bfb7ad840

10 years agoReword Windows makefile comments to explain the "help" logic about USE_MULTI
Steve Hay [Tue, 1 Apr 2014 12:31:10 +0000 (13:31 +0100)]
Reword Windows makefile comments to explain the "help" logic about USE_MULTI

There is logic to auto-enable USE_MULTI if either USE_ITHREADS or USE_IMP_SYS
(which both require USE_MULTI) are enabled, but this is not mentioned in
the comments. Explain it so that users don't get confused when trying to
disable USE_MULTI.

Reported in [perl #121494].

10 years agoStart updating perldelta for 5.19.11
Steve Hay [Sun, 30 Mar 2014 19:59:02 +0000 (20:59 +0100)]
Start updating perldelta for 5.19.11

10 years agoCommit b776cec188 missed these RMG steps when preparing Module::CoreList for 5.19.11
Steve Hay [Sun, 30 Mar 2014 19:27:30 +0000 (20:27 +0100)]
Commit b776cec188 missed these RMG steps when preparing Module::CoreList for 5.19.11

10 years agoperldelta: /\C/ will be an error in 5.24
David Mitchell [Sat, 29 Mar 2014 19:35:37 +0000 (19:35 +0000)]
perldelta: /\C/ will be an error in 5.24

Update the recently added perldelta entry to say that /\C/ will become an
error rather than becoming equal to /./.

10 years agoRMG - refer to BLEAD-POINT/BLEAD-FINAL releases for consistency and clarity
Steve Hay [Fri, 28 Mar 2014 22:05:29 +0000 (22:05 +0000)]
RMG - refer to BLEAD-POINT/BLEAD-FINAL releases for consistency and clarity

10 years agoRMG - note that CPAN module upgrades are subject to code freeze restrictions
Steve Hay [Fri, 28 Mar 2014 21:53:10 +0000 (21:53 +0000)]
RMG - note that CPAN module upgrades are subject to code freeze restrictions

(As confirmed on p5p by RJBS on 24 March 2014.)

10 years agoRMG - we no longer have UPSTREAM => 'undef' in Porting/Maintainers.pl
Steve Hay [Fri, 28 Mar 2014 21:40:49 +0000 (21:40 +0000)]
RMG - we no longer have UPSTREAM => 'undef' in Porting/Maintainers.pl

10 years agoMaintainers.pl synchronised for CPAN release of ExtUtils-Install
Chris 'BinGOs' Williams [Fri, 28 Mar 2014 14:02:51 +0000 (14:02 +0000)]
Maintainers.pl synchronised for CPAN release of ExtUtils-Install

10 years agofix killpg on Win32, to meet posix expectations for killpg
Daniel Dragan [Thu, 27 Mar 2014 07:37:03 +0000 (03:37 -0400)]
fix killpg on Win32, to meet posix expectations for killpg

On Win32 Perls built without PERL_IMPLICIT_SYS, killpg from win32.c was
directly called by Perl_apply, yet killpg's return value had Win32
behavior, not POSIX behavior. Modify killpg token to have same meaning as
PerlProcKillpg/PerlProc_killpg has on PERL_IMPLICIT_SYS builds. Use a
macro rather than create a win32_killpg C function since win32_killpg would
be nothing but a call to win32_kill anyways. win32_kill contains the Win32
to POSIX semantics conversion code. Rename old killpg to my_killpg since
it has no use outside of win32.c. The psuedo-PID code in win32_kill also
played a factor in not writing a separate win32_killpg that calls
my_killpg. This fix is tested by kill0.t passing on
no-PERL_IMPLICIT_SYS builds.

[perl #121230]

10 years agoperlrebackslash, perlreref.pod: White space only
Karl Williamson [Wed, 26 Mar 2014 18:36:54 +0000 (12:36 -0600)]
perlrebackslash, perlreref.pod: White space only

Fit verbatim lines into 79 columns

10 years agoRevert "Add support for test.valgrind parallel testing"
Karl Williamson [Wed, 26 Mar 2014 18:23:33 +0000 (12:23 -0600)]
Revert "Add support for test.valgrind parallel testing"

This reverts commit f0aff2daa44923f600f6e1f2429a2add2214a9d5
"Add support for test.valgrind parallel testing"

This patch was accidentally pushed (by me); it breaks some things.  We
will wait to add this support until after 5.20

10 years agoDeprecate /\C/
David Mitchell [Wed, 26 Mar 2014 12:07:39 +0000 (12:07 +0000)]
Deprecate /\C/

For 5.20, just say its deprecated. We'll add a warning in 5.22
and change its behaviour in 5.24.

10 years ago[perl #121366] avoid using an invalid SvPVX() in Perl_sv_pvn_force_flags
Tony Cook [Wed, 26 Mar 2014 03:31:57 +0000 (14:31 +1100)]
[perl #121366] avoid using an invalid SvPVX() in Perl_sv_pvn_force_flags

This would cause valgrind to complain about:

  vec($Foo, 0, 1) = 1; # for example

when $Foo was undef, since SvPVX()[1] isn't initialized until the SV is
at least a SVt_PV.

[1] well, sv_u.svu_rv, but sv_u is a union, so the same memory is
initialized.  This isn't technically legal from a C point of view,
but pointer types are compatible enough with each other for it to not
be an issue.

10 years agoUpdate ExtUtils-MakeMaker to CPAN version 6.94
Chris 'BinGOs' Williams [Tue, 25 Mar 2014 20:48:56 +0000 (20:48 +0000)]
Update ExtUtils-MakeMaker to CPAN version 6.94

  [DELTA]

6.94 Tue Mar 25 19:26:31 GMT 2014

    No changes from 6.93_01

6.93_01 Mon Mar 24 16:53:31 GMT 2014
    Bug fixes:
    * Resolved a regression in MM_Unix.pm
      (https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues/96)

10 years agoSynchronise versions in Maintainers.pl
Chris 'BinGOs' Williams [Mon, 24 Mar 2014 20:07:54 +0000 (20:07 +0000)]
Synchronise versions in Maintainers.pl

10 years ago[perl #121484] /m causing false negative
David Mitchell [Mon, 24 Mar 2014 15:36:32 +0000 (15:36 +0000)]
[perl #121484] /m causing false negative

My recent commit d0d4464849e2b30aee8 in re_intuit_start() reduced the
scope of a 'skip if multiline' check, so that certain optimisations
weren't being unnecessarily skipped. Unfortunately it didn't reduce the
scope enough, so a vital slen-- was being skipped in the
SvTAIL-but-don't-fail case.

This commit just moves the !multiline test further down, and updates the
commentary and condition formatting a bit.

10 years ago#121395 fix, on Win32 test.pl watchdog always blocks for entire timeout
bulk88 [Mon, 24 Mar 2014 01:01:15 +0000 (21:01 -0400)]
#121395 fix, on Win32 test.pl watchdog always blocks for entire timeout

See Perl RT #121395 for details.

10 years agoRemove MM_TEST_ROOT feature from ExtUtils::Install tests.
Craig A. Berry [Sun, 23 Mar 2014 18:33:49 +0000 (13:33 -0500)]
Remove MM_TEST_ROOT feature from ExtUtils::Install tests.

This feature depended on test directories created on the fly being
in a predictable location, but as of 80af860fb39a3c6 they no longer
are.  VMS systems released in the last 15 years or so don't even
need the feature, so the best path forward is to get rid of it.

A corresponding change was made in ExtUtils::MakeMaker 6.79_01 but
ExtUtils::Install maintains its own fork of the same test libraries.

10 years agoReduce excessive stat calls in glob on VMS.
Craig A. Berry [Sat, 22 Mar 2014 00:29:38 +0000 (19:29 -0500)]
Reduce excessive stat calls in glob on VMS.

When PERL_EXTERNAL_GLOB is defined (currently only on VMS, or on other
platforms when running miniperl), each item returned from the glob
operation is checked against a set of glob metacharacters, and then, if
it matches any of these characters, it's checked with lstat() to see if
it actually exists.  Then it's passed through if it exists but skipped
otherwise.  Presumably this is because returning the pattern unchanged
is how a shell glob indicates "no match."

It appears that the lstat() is necessary because glob metacharacters
are almost always valid filename characters on Unix, so it's the
only way to distinguish a funny-looking but real filename from the no
match case (oops -- indeterminate grammar).  Since these filenames are
rare on Unix, lstat() is seldom called.

Enter VMS, where "external glob" is neither external, nor is it actually
a glob.  It is a native wildcard-matching search built into Perl with
vms/vms.c's Perl_vms_start_glob(), which does return the original
pattern when there is no match, but that pattern will only contain
native wildcard characters, so the check for glob metacharacters is
really not the right thing to be doing.  Moreover, glob metacharacters
such as dollar signs, brackets, and semicolons are extremely common in
native VMS paths, so in many common scenarios, the lstat() to see if the
file really exists gets triggered for every single file, which is
expensive.

This commit replaces, on VMS only, the check for glob metacharacters
with a check for VMS wildcard characters.  A simple glob of a Perl
source tree becomes 60% faster on the first iteration and 80% faster on
subsequent iterations.

Thanks to Hein van den Heuvel, who reported the problem and explained
that a search operation should only be looking at directory files,
whereas a stat does I/O to the individual file header, resulting in a
massive increase in unnecessary I/O.

This closes [perl #121440].

10 years agoAdd 5.19.10 announcement URL to list of epigraphs
Aaron Crane [Fri, 21 Mar 2014 10:29:59 +0000 (10:29 +0000)]
Add 5.19.10 announcement URL to list of epigraphs

And fix the error in the author's name; it's John Chadwick and Michael
Ventris, not the other way round.

10 years agoPrepare Module::CoreList for next release
Aaron Crane [Thu, 20 Mar 2014 22:57:16 +0000 (22:57 +0000)]
Prepare Module::CoreList for next release

10 years agoBump to Perl version 5.19.11
Aaron Crane [Thu, 20 Mar 2014 22:46:48 +0000 (22:46 +0000)]
Bump to Perl version 5.19.11

10 years agoNew perldelta for 5.19.11
Aaron Crane [Thu, 20 Mar 2014 22:37:34 +0000 (22:37 +0000)]
New perldelta for 5.19.11

10 years agoRecord the 5.19.10 epigraph
Aaron Crane [Thu, 20 Mar 2014 22:39:25 +0000 (22:39 +0000)]
Record the 5.19.10 epigraph

The announcement URL is not yet available, but will be filled in soon.

10 years agoMerge release branch for Perl 5.19.10
Aaron Crane [Thu, 20 Mar 2014 19:38:03 +0000 (19:38 +0000)]
Merge release branch for Perl 5.19.10

10 years agoUpdate perlhist for 5.19.10 v5.19.10
Aaron Crane [Thu, 20 Mar 2014 18:07:06 +0000 (18:07 +0000)]
Update perlhist for 5.19.10

10 years agoFinalise perldelta for 5.19.10
Aaron Crane [Thu, 20 Mar 2014 18:01:33 +0000 (18:01 +0000)]
Finalise perldelta for 5.19.10

10 years agoUpdate Module::CoreList for 5.19.10
Aaron Crane [Thu, 20 Mar 2014 16:36:48 +0000 (16:36 +0000)]
Update Module::CoreList for 5.19.10

10 years agoPorting/corelist-perldelta.pl: fix bug with 5.*.10 releases
Aaron Crane [Thu, 20 Mar 2014 17:13:56 +0000 (17:13 +0000)]
Porting/corelist-perldelta.pl: fix bug with 5.*.10 releases

The two aliases of the new Perl version (in this case, "5.01901" and
"5.019010") were being selected as the two versions to compare.
Unsurprisingly, those two versions have the same modules, so the
generated summary of changes was empty.

10 years agoPorting/corelist-perldelta.pl: fix minor POD error
Aaron Crane [Thu, 20 Mar 2014 17:13:39 +0000 (17:13 +0000)]
Porting/corelist-perldelta.pl: fix minor POD error

10 years agoPorting/corelist-perldelta.pl: fix typo in error message
Aaron Crane [Thu, 20 Mar 2014 17:12:57 +0000 (17:12 +0000)]
Porting/corelist-perldelta.pl: fix typo in error message

10 years agoUpgrade Devel::PPPort from 3.21 to 3.22
Aaron Crane [Thu, 20 Mar 2014 15:54:11 +0000 (15:54 +0000)]
Upgrade Devel::PPPort from 3.21 to 3.22

  [DELTA]

    * Add support for the following API
        SvREFCNT_dec_NN
        mg_findext
        sv_unmagicext
    * Update META
        Move bug tracker to github
        Provide link to repository

10 years agoUpdate perldelta for recent core changes
Aaron Crane [Thu, 20 Mar 2014 13:32:16 +0000 (13:32 +0000)]
Update perldelta for recent core changes

10 years agoExtUtils-Install-1.63 has been released to CPAN
Aaron Crane [Thu, 20 Mar 2014 15:31:34 +0000 (15:31 +0000)]
ExtUtils-Install-1.63 has been released to CPAN

10 years agoThe linux hints file should only look for -lgdbm_compat if -lgdbm is wanted.
Nicholas Clark [Wed, 19 Mar 2014 10:30:07 +0000 (11:30 +0100)]
The linux hints file should only look for -lgdbm_compat if -lgdbm is wanted.

Previously they would unconditionally add gdbm_compat to the list of wanted
libraries. This is unhelpful if the user has passed Configure arguments to
constrain the library search to avoid libgdbm.so, because Configure would
still end up finding libgdbm_compat.so, which at best is not useful without
libgdbm.so, and at worse could have the same problems that caused the
user to avoid libgdbm.so (eg not compatible with the current compiler flags)

10 years agosync-with-cpan: allow digits after -TRIAL
Ricardo Signes [Thu, 20 Mar 2014 14:00:56 +0000 (10:00 -0400)]
sync-with-cpan: allow digits after -TRIAL

10 years agohv.h: tweak comment about HvAUX preallocation for large hashes
Aaron Crane [Thu, 20 Mar 2014 12:39:20 +0000 (12:39 +0000)]
hv.h: tweak comment about HvAUX preallocation for large hashes

10 years agoUpgrade CPAN from 2.03-TRIAL to 2.04-TRIAL
Aaron Crane [Wed, 19 Mar 2014 16:15:21 +0000 (16:15 +0000)]
Upgrade CPAN from 2.03-TRIAL to 2.04-TRIAL

  [DELTA]

    2014-03-18  Andreas Koenig  <k@UX31A>

    * release 2.04-TRIAL

    * history of master branch was rewritten after Tour de France bughunting
    (Lyon #QA2014); apologies to all repository followers: the real history,
    as it actually went, is not worth being recorded in the master branch.

    * address #91706 and #86915: the 'force install' bug and the endless
    loop bugs reported in the two tickets are fixed (joined forces)

    * new configure option 'use_prompt_default' (David Golden)

    * add new dummy distros OptionalPrereq and CircularPrereq for testing
    recommends/suggests support

    * experimental recommends/suggests support (David Golden, Andreas Koenig)

    * enable hiding of directories in the distroprefs tree (suggested by
    Slaven Rezić)

10 years ago[MERGE] audit anchoring in re_intuit_start()
David Mitchell [Wed, 19 Mar 2014 19:28:47 +0000 (19:28 +0000)]
[MERGE] audit anchoring in re_intuit_start()

This series of commits audits all the code in re_intuit_start()
that handles anchoring, e.g. /^.../, /^.../m, /\G.../.

It fixes a couple of potential performance issues, and makes the code a
lot safer with with \G. (Until recently, intuit was skipped altogether
under \G, so its \G handling isn't well developed and tested.)

10 years agore_intuit_start(): move comments abut IMPLICIT
David Mitchell [Wed, 19 Mar 2014 18:05:24 +0000 (18:05 +0000)]
re_intuit_start(): move comments abut IMPLICIT

After the previous reworking of the PREGf_IMPLICIT tests, move commentary
about PREGf_IMPLICIT closer to where its now relevant.

10 years agore_intuit_start(): don't unset MBOL on uselessness
David Mitchell [Wed, 19 Mar 2014 17:37:20 +0000 (17:37 +0000)]
re_intuit_start(): don't unset MBOL on uselessness

When BmUSEFUL() for a pattern goes negative, we unset ~RXf_USE_INTUIT.

A bug fix in 2010 (c941595168) made this part of the code also remove
the RXf_ANCH_MBOL at the same time, if PREGf_IMPLICIT was set.

However, this was really just working round a bug in regexec_flags().
Once intuit was disabled, regexec_flags() would then start taking the
buggy code path.

This buggy code path was separately fixed in 2012 by 21eede782, so there's
no longer any need to remove this flag. So don't.

10 years agore_intuit_start(): change definition of ml_anch
David Mitchell [Wed, 19 Mar 2014 16:44:25 +0000 (16:44 +0000)]
re_intuit_start(): change definition of ml_anch

The ml_anch variable is supposed to indicate that a multi-line match is
possible, i.e. that the regex is anchored to a \n.

Currently we just do

    ml_anch = (prog->intflags & PREGf_ANCH_MBOL);

However, MBOL is also set on /.*..../; the two cases are distinguished by
adding the PREGf_IMPLICIT flag too.

So at the moment we have lots of tests along the lines of

    if (ml_anch && !(prog->intflags & PREGf_IMPLICIT))

Simplify this by adding the IMPLICIT condition when initially calculating
ml_anch, so there's no need to keep testing for it later. This also means
that ml_anch actually means what it says now.

10 years agore_intuit_start(): check for IMPLICIT in abs anch
David Mitchell [Wed, 19 Mar 2014 16:34:28 +0000 (16:34 +0000)]
re_intuit_start(): check for IMPLICIT in abs anch

The block of code that deals with absolute anchors looks like:

    if (...) {
        if (.... && !PREGf_IMPLICIT) ...;
        if (FOO) {
            assert(!PREGf_IMPLICIT);
            ....
        }
    }

where the constraints of FOO imply PREGf_IMPLICIT, as shown by the
assertion. Simplify this to:

    if (... && !PREGf_IMPLICIT) {
        if (....) ...;
        if (FOO) {
            ....
        }
    }

10 years agore_intuit_start(): check for IMPLICIT in stclass
David Mitchell [Wed, 19 Mar 2014 14:58:19 +0000 (14:58 +0000)]
re_intuit_start(): check for IMPLICIT in stclass

In the stclass block of code, there are various checks for anchored-ness.
Add !(prog->intflags & PREGf_IMPLICIT) to these conditions, since
from the perspective of these tests, we can only quit early etc if these
are real rather than fake anchors.

As it happens, this currently makes no logical difference, since an
PREGf_IMPLICIT pattern starts with .*, and so more or less by definition
can't have an stclass.

So this commit is really only for logical completeness, and to allow us to
change the definition of ml_anch shortly.

10 years agore_intuit_start(): use better limit on anch float
David Mitchell [Tue, 18 Mar 2014 23:36:20 +0000 (23:36 +0000)]
re_intuit_start(): use better limit on anch float

The 'check' block of code has special handling for if the pattern is
anchored; in this case, it allows us to set an upper bound on where a
floating substring might match; e.g. in

    /^..\d?abc/

the floating string can't be more than 3 chars from the absolute beginning
of the string. Similarly with /..\G\d?abc/, it can't be more than 3 chars
from the start position (assuming that position been calculated correctly
by the caller).

However, the current code used rx_origin as the base for the offset
calculation, rather than strbeg/strpos as appropriate. This meant that

a) the first time round the loop, if strpos > strbeg, then the upper bound
would be set higher than needed;
b) if we ever go back to restart: with an incremented rx_origin, then the
upper limit is recalculated with more wasted slack at the latter end.

This commit changes the limit calculation, which reduces the following
from second to milliseconds:

    $s = "abcdefg" x 1_000_000;
    $s =~ /^XX\d{1,10}cde/ for 1..100;

It also adds a quick test to skip hopping when the result is likely to
leave end_point unchanged, and adds an explicit test for !PREGf_IMPLICIT.
This latter test isn't strictly necessary, as if PREGf_IMPLICIT were set,
it implies that the pattern starts with '.*', which implies that
prog->check_offset_max == SSize_t_MAX, which is already tested for.
However, it makes the overall condition more comprehensible, and makes it
more robust in the face of future changes.

10 years agore_intuit_start(): do 'not at start' check on BOL
David Mitchell [Tue, 18 Mar 2014 21:32:39 +0000 (21:32 +0000)]
re_intuit_start(): do 'not at start' check on BOL

The quick reject test that says "if a pattern has an absolute anchor,
then immediately reject if strpos != strbeg", currently skips that test
if PREGf_ANCH_GPOS is present. Instead, skip unless BOL or SBOL is present.

This means that something like /^abc\G/ will still do the quick reject
test.

I can't think of any example that will actually give a measurable
performance boost, and this is a fairly unlikely scenario, but the code is
more logical this way, and makes it more robust against future changes
(it's less likely to suddenly skip the quick test where it used to do it).

I've also updated the commentary on why we don't do a quick /\G/ test
akin to the /^/ test, and added some more info about why we test for the
PREGf_IMPLICIT flag.

And I've added an assert about PREGf_IMPLICIT too.

10 years agore_intuit_start(): reduce scope of /^...$/m test
David Mitchell [Tue, 18 Mar 2014 20:15:27 +0000 (20:15 +0000)]
re_intuit_start(): reduce scope of /^...$/m test

Intuit has a quick reject test for a fixed pattern that is anchored at
both ends. For example, with the pattern /^abcd$/, only the exact strings
"abcd" or "abcd\n" will match; anything else, and the match immediately
fails.

A fix for [perl #115242] correctly made intuit skip the test in the
presence of //m, since in this case the $ doesn't necessarily correspond
to the end of the string.

However, the fix was too wide in scope; it caused //m patterns to skip
searching for a known string anchored just at the start, as well as one
anchored at both ends.

With this commit, the following code now runs in a few milliseconds rather
than a few seconds on my machine:

    $s = "abcdefg" x 1_000_000;
    $s =~ /(?-m:^)abcX?fg/m for 1..100;

10 years agore_intuit_start(): change !ml_anch debugging msg
David Mitchell [Tue, 18 Mar 2014 16:10:59 +0000 (16:10 +0000)]
re_intuit_start(): change !ml_anch debugging msg

When MBOL (/^.../m) matching is skipped, the debugging output looks like:

    Starting position does not contradict /^/m...

which sounds a bit like the \n test *was* done and passed, rather than
the test being skipped. Change the message to:

    (multiline anchor test skipped)

10 years agore_intuit_start(): don't set ml_anch on BOL
David Mitchell [Tue, 18 Mar 2014 15:26:00 +0000 (15:26 +0000)]
re_intuit_start(): don't set ml_anch on BOL

re_intuit_start() decided that a pattern was capable of being anchored
after *any* \n in the string for a //m pattern that contains a BOL
(rather than an MBOL). This can happen by embedding one regex in another
for example.

This is an incorrect assumption, and means that intuit() might try
against every \n position in the string rather than just trying at the
beginning. With this commit, the following code on my machine reduces in
execution time from 7000ms to 5ms:

    my $r = qr/^abcd/;
    my $s = "abcd-xyz\n" x 500_000;
    $s =~ /$r\d{1,2}xyz/m for 1..200;

10 years agoPorting/sync-with-cpan: allow "-TRIAL" version numbers
Aaron Crane [Wed, 19 Mar 2014 16:56:09 +0000 (16:56 +0000)]
Porting/sync-with-cpan: allow "-TRIAL" version numbers

10 years agoMerge the refactoring of Perl_do_openn() to blead.
Nicholas Clark [Wed, 19 Mar 2014 10:03:04 +0000 (11:03 +0100)]
Merge the refactoring of Perl_do_openn() to blead.

This makes Perl_do_openn() a wrapper around two functions Perl_do_open_raw()
and Perl_do_open6(), which provide sysopen and open functionality.
In turn, shared setup and cleanup code from these two is moved to two static
functions S_openn_setup() and S_openn_cleanup().

For now both functions are not part of the public API, as they may change,
and offer no functionality that isn't already accessible via Perl_do_openn().

These changes make it easi*er* to follow the twisted logic of open.

10 years agoIn Perl_nextargv(), move variable declarations into the blocks that use them.
Nicholas Clark [Sun, 2 Mar 2014 09:12:08 +0000 (10:12 +0100)]
In Perl_nextargv(), move variable declarations into the blocks that use them.

This makes it clearer that variables don't hold values between iterations of
the loop, and permits the variable sv to be made const.

10 years agoSimplify the code in Perl_nextargv().
Nicholas Clark [Sun, 2 Mar 2014 09:02:51 +0000 (10:02 +0100)]
Simplify the code in Perl_nextargv().

Split the ternary that called Perl_do_open_raw() and Perl_do_open6() based
on PL_inplace into two different if blocks, and merge these with the following
code which is also conditional on PL_inplace.

Remove the warning code from an else block and re-indent it, to make it clear
that it is always called if control reaches the end of the while loop.

10 years agoChange core uses of Perl_do_openn() to Perl_do_open6() or Perl_do_open_raw().
Nicholas Clark [Sun, 2 Mar 2014 08:50:38 +0000 (09:50 +0100)]
Change core uses of Perl_do_openn() to Perl_do_open6() or Perl_do_open_raw().

Calls to Perl_do_openn() all have at least 2 unused arguments which clutter
the code and hinder easy understanding. Perl_do_open6() and
Perl_do_open_raw() each only do one job, so don't have the dead arguments.

10 years agoSplit Perl_do_openn() into Perl_do_open_raw() and Perl_do_open6().
Nicholas Clark [Sun, 2 Mar 2014 08:26:29 +0000 (09:26 +0100)]
Split Perl_do_openn() into Perl_do_open_raw() and Perl_do_open6().

Perl_do_open_raw() handles the as_raw part of Perl_do_openn().
Perl_do_open6() handles the !as_raw part of Perl_do_openn().
do_open6() isn't a great name, but I can't see an obvious concise name that
covers 2 arg open, 3 arg open, piped open, implicit fork, and layers.

10 years agoExtract the cleanup code of Perl_do_openn() into S_openn_cleanup().
Nicholas Clark [Sun, 2 Mar 2014 07:14:13 +0000 (08:14 +0100)]
Extract the cleanup code of Perl_do_openn() into S_openn_cleanup().

A 12 parameter function is extremely ugly (as demonstrated by the need to add
macros for it to perl.h), but it's private, and it will permit the two-headed
public interface of Perl_do_openn() to be simplified.

10 years agoExtract the setup code of Perl_do_openn() into S_openn_setup().
Nicholas Clark [Sun, 2 Mar 2014 06:38:00 +0000 (07:38 +0100)]
Extract the setup code of Perl_do_openn() into S_openn_setup().

10 years agoIn Perl_do_openn(), disambiguate the two separate uses of the variable fd.
Nicholas Clark [Sat, 1 Mar 2014 21:53:52 +0000 (22:53 +0100)]
In Perl_do_openn(), disambiguate the two separate uses of the variable fd.

Rename the first uses of the variable fd to wanted_fd to show that the
variable is not used to pass a value to later in the function.

10 years agoIn Perl_do_openn(), move the variable result into the block that uses it.
Nicholas Clark [Sat, 1 Mar 2014 21:38:18 +0000 (22:38 +0100)]
In Perl_do_openn(), move the variable result into the block that uses it.

This also removes a couple of places which would set result = 0 to simulate
"success" for an a later if block. Those paths now don't even reach that
if block.

10 years agoPerl_do_openn() doesn't need to set num_svs and svp.
Nicholas Clark [Sat, 1 Mar 2014 20:32:19 +0000 (21:32 +0100)]
Perl_do_openn() doesn't need to set num_svs and svp.

These variables are no longer used later in the function, so no need to set
them. This permits the declaration of the variable namesv to be moved from
the top of the function into the blocks that use it.

10 years agoPerl_do_openn() should call PerlIO_openn() with arg NULL if narg is 0.
Nicholas Clark [Sat, 1 Mar 2014 20:10:38 +0000 (21:10 +0100)]
Perl_do_openn() should call PerlIO_openn() with arg NULL if narg is 0.

If narg is NULL, then PerlIO_openn() doesn't look at args.

(Technically except for PerlIOStdio_open() if f is non-NULL, which doesn't
check narg and assumes that args[0] is valid. That lack of check is probably
a bug. But it doesn't matter in this case, as f is NULL)

This makes it clear that arg isn't needed at this point in Perl_do_openn().

This is a more complete version of the change made by commit dd37d22f759197ae
(March 2002), which just changed the call to pass 0 for narg.

10 years agoIn Perl_do_openn(), move {in,out}_{raw,crlf} into the !as_raw block.
Nicholas Clark [Sat, 1 Mar 2014 21:00:29 +0000 (22:00 +0100)]
In Perl_do_openn(), move {in,out}_{raw,crlf} into the !as_raw block.

These 4 variables are only needed there, so by moving them into the block we
save doing unneeded work for the as_raw case (ie sysopen), and as a side
effect make the function a bit clearer.

10 years agoTests that warnings are emitted if in-place edit fails to open a pathname.
Nicholas Clark [Sun, 2 Mar 2014 14:36:52 +0000 (15:36 +0100)]
Tests that warnings are emitted if in-place edit fails to open a pathname.

These have the same text as other warnings which are tested. However the
existing tests only covered the code path where a directory was able to be
opened (read only) and then caught by an explicit stat test for non-files.

10 years agoFix minor inaccuracy in the release manager's guide
Aaron Crane [Tue, 18 Mar 2014 18:51:54 +0000 (18:51 +0000)]
Fix minor inaccuracy in the release manager's guide

10 years agoUpgrade Digest-SHA from 5.87 to 5.88
Aaron Crane [Tue, 18 Mar 2014 18:50:38 +0000 (18:50 +0000)]
Upgrade Digest-SHA from 5.87 to 5.88

  [DELTA]

        - added OUTPUT clause in SHA.xs to silence compiler warning
                -- ref. shaclose()
        - changed text file test (-T) to act on filehandles
                -- ref. addfile portable mode
                -- improves consistency when reading from STDIN
                -- still acts on filenames for early Perls (< 5.6)
        - added -M and -V options to shasum
                -- undocumented: for development and testing use only

10 years agoPorting/todo.pod: Use F<> instead of C<>
Karl Williamson [Tue, 18 Mar 2014 18:45:49 +0000 (12:45 -0600)]
Porting/todo.pod: Use F<> instead of C<>

A file path is supposed to be enclosed in F<>

10 years agomktables: In-line defns for tables up to 3 ranges
Karl Williamson [Tue, 18 Mar 2014 18:17:16 +0000 (12:17 -0600)]
mktables: In-line defns for tables up to 3 ranges

eb0925341cc65ce6ce57503ec0ab97cdad39dc98 caused the definitions for
about 45% of the Unicode tables to be placed in-line in Heavy.pl instead
of them having to be read-in from disk.  This new commit extends that so
that about 55% are in-lined, by in-lining tables which consist of up to
3 ranges.

This is a no-brainer to do, as the memory usage does not increase by
doing it, and disk accesses go down.  I used the delta in the disk size
of Heavy.pl as a proxy for the delta in the memory size that it uses,
as what this commit does is to change various scalar strings in it.
Doing this measurement indicates that this commit results in a slightly
smaller Heavy.pl than what was there before eb092534.  The amounts will
vary between Unicode releases.  I also checked for Unicode beta 7.0, and
the sizes are again comparable, with a slightly larger Heavy.pl for the
3-range version there.

For 4-, 5-, ... range tables, doing this results in slowly increasing
Heavy.pl size (and hence more and more memory use), and that is
something we may wish to look at in the future, trading memory for fewer
files and less disk start-up cost.  But for the imminent v5.20, doing it
for 3-range tables doesn't cost us anything, and gains us fewer disk
files and accesses.

10 years agomktables: Remove obsolete sort constraint
Karl Williamson [Tue, 18 Mar 2014 18:10:46 +0000 (12:10 -0600)]
mktables: Remove obsolete sort constraint

Zero-length tables are no longer expressed in terms of the Perl 'All'
property, so the sort no longer has to make sure the latter is processed
before the former.

10 years agomktables: Add comments, reorder a gen'd file
Karl Williamson [Tue, 18 Mar 2014 18:09:25 +0000 (12:09 -0600)]
mktables: Add comments, reorder a gen'd file

This adds some clarifying comments, and reorders Heavy.pl so the array
referred to by two hashes occurs before both hashes in the output.

10 years agomktables: White-space only
Karl Williamson [Tue, 18 Mar 2014 18:07:55 +0000 (12:07 -0600)]
mktables: White-space only

This indents code to conform to the new block created in the previous
commit

10 years agoutf8_heavy.pl: Change data structure for in-lined definitions
Karl Williamson [Tue, 18 Mar 2014 17:43:59 +0000 (11:43 -0600)]
utf8_heavy.pl: Change data structure for in-lined definitions

This commit puts the in-lined definitions introduced by
eb0925341cc65ce6ce57503ec0ab97cdad39dc98 into a separate array,
where each element is a unique definition.  This can result in slightly
smaller current memory usage in utf8_heavy.pl, as the strings giving the
file names now only appear once, and what replaces them in the hash
values are strings of digits indices, which are shorter.

But doing this allows us in a later commit to increase the number of
ranges in the tables that get in-lined, without increasing memory usage.

This commit also changes the code that generates the definitions to be
more general, so that it becomes trivial to change things to generate
in-line definitions for tables with more than one range.

10 years agomktables: Fix overlooked in-line table defns code
Karl Williamson [Tue, 18 Mar 2014 16:39:53 +0000 (10:39 -0600)]
mktables: Fix overlooked in-line table defns code

Commit eb0925341cc65ce6ce57503ec0ab97cdad39dc98 introduced the idea of a
pseudo-directory as a way to store table definitions in-line in
Heavy.pl, but conform to the expectations of the code in regard to
objects being files within directories.  This kept the needed changes to
a minimum.  The code changed by the current commit  was overlooked then
as something that also needed to change, because there are no current
instances of it needing to.  But this could change with future Unicode
versions, or as in the next few commits, in extending the in-line
definitions.

10 years agoAdd support for test.valgrind parallel testing
Matthew Horsfall (via RT) [Thu, 13 Mar 2014 12:39:48 +0000 (05:39 -0700)]
Add support for test.valgrind parallel testing

# New Ticket Created by  Matthew Horsfall
# Please include the string:  [perl #121431]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=121431 >

This is a bug report for perl from wolfsage@gmail.com,
generated with the help of perlbug 1.39 running under perl 5.14.2.

-----------------------------------------------------------------
[Please describe your issue here]

The included patch allows test.valgrind to run tests in parallel.

Valgrind output for each test will be printed out after the test
completes, with the name of the test prefixing every line.

Example usage might be:

  TEST_JOBS=8 make test.valgrind VALGRIND='valgrind -q' 2>&1 | tee out.txt

-q is needed to ensure only *errors* are captured, otherwise the output will
be much louder than it already is. (Perhaps this should be the default mode?)

[Please do not change anything below this line]
-----------------------------------------------------------------

10 years agoMerge perllexwarn.pod into warnings.pm
Ricardo Signes [Tue, 18 Mar 2014 17:29:54 +0000 (13:29 -0400)]
Merge perllexwarn.pod into warnings.pm

10 years agoregenerate warnings.pm
Ricardo Signes [Tue, 18 Mar 2014 17:29:42 +0000 (13:29 -0400)]
regenerate warnings.pm

10 years agodo not podcheck regen/warnings.pl
Ricardo Signes [Tue, 18 Mar 2014 17:24:50 +0000 (13:24 -0400)]
do not podcheck regen/warnings.pl

10 years agowarnings.pm: improve awkward sentence in pod
Ricardo Signes [Tue, 18 Mar 2014 17:16:08 +0000 (13:16 -0400)]
warnings.pm: improve awkward sentence in pod

10 years agobump the version of warnings.pm
Ricardo Signes [Fri, 14 Mar 2014 08:28:38 +0000 (09:28 +0100)]
bump the version of warnings.pm

(and of regen/warnings.pl)

10 years agoreplace links to perllexwarn with links to warnings
Ricardo Signes [Fri, 14 Mar 2014 08:15:36 +0000 (09:15 +0100)]
replace links to perllexwarn with links to warnings

or, sometimes, simply remove them

10 years agoremove references to perllexwarn from warnings.pm
Ricardo Signes [Fri, 14 Mar 2014 08:11:28 +0000 (09:11 +0100)]
remove references to perllexwarn from warnings.pm

10 years agoregen/warnings.pl no longer touches perllexwarn
Ricardo Signes [Fri, 14 Mar 2014 08:09:29 +0000 (09:09 +0100)]
regen/warnings.pl no longer touches perllexwarn

10 years agoturn perllexwarn into a stub
Ricardo Signes [Fri, 14 Mar 2014 08:09:09 +0000 (09:09 +0100)]
turn perllexwarn into a stub

10 years agomerge most of perllexwarn into warnings
Ricardo Signes [Fri, 14 Mar 2014 08:04:09 +0000 (09:04 +0100)]
merge most of perllexwarn into warnings

10 years agoreplace printTree with warningsTree
Ricardo Signes [Fri, 14 Mar 2014 07:51:31 +0000 (08:51 +0100)]
replace printTree with warningsTree

we return, rather than print, the warnings, so we can potentially
futz around with the string and put it where we like without
having to worry about C<select>

10 years agoenclose warnings.h generation in a block
Ricardo Signes [Fri, 14 Mar 2014 07:45:06 +0000 (08:45 +0100)]
enclose warnings.h generation in a block

...to limit the number of variables visible everywhere and
make it a bit easier to see what I am doing as I refactor
regen/warnings.pl

10 years agoFix uninitialized-value warnings in Thread::Queue
Aaron Crane [Tue, 18 Mar 2014 17:17:54 +0000 (17:17 +0000)]
Fix uninitialized-value warnings in Thread::Queue

This involves a version bump, to 3.05.