This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
9 years agoupdate release schedule
Ricardo Signes [Fri, 6 Jun 2014 01:23:58 +0000 (21:23 -0400)]
update release schedule

9 years agoperlapi: Place in dictionary sort order
Karl Williamson [Thu, 5 Jun 2014 20:58:49 +0000 (14:58 -0600)]
perlapi: Place in dictionary sort order

Underscores or their lack can confuse people in finding sorted items.

9 years agoperlapi: Refactor placements, headings of some functions
Karl Williamson [Thu, 5 Jun 2014 20:29:44 +0000 (14:29 -0600)]
perlapi: Refactor placements, headings of some functions

It is not very user friendly to list functions as
"Functions found in file FOO".  Better is to group them by purpose, as
many were already.  I went through and placed the ones that weren't
already so grouped into groups.  Patches welcome if you have a better
classification.

I changed the headings of some so that the important disctinction was
the first word so that they are placed in the file more appropriately.

And a couple of ones that I had created myself, I came up with a name
that I think is better than the original

9 years agoperlapi: Include general information
Karl Williamson [Thu, 5 Jun 2014 20:22:50 +0000 (14:22 -0600)]
perlapi: Include general information

Unlike other pod handling routines, autodoc requires the line following
an =head1 to be non-empty for its text to be included in the paragraph
started by the heading.  If you fail to do this, silently the text will
be omitted from perlapi.  I went through the source code, and where it
was apparent that the text was supposed to be in perlapi, deleted the
empty line so it would be, with some revisions to make more sense.

I added =cuts where I thought it best for the text to not be included.

9 years agoMove a VMS-specific include file in sv.c.
Craig A. Berry [Thu, 5 Jun 2014 20:44:52 +0000 (15:44 -0500)]
Move a VMS-specific include file in sv.c.

C++ doesn't allow pulling in rms.h smack dab in the middle of a
function like that.  While we're in there, go ahead and start
using the correct __VMS macro instead of just VMS.  The latter
was only necessary for VAX C, the non-C89-compliant predecessor
to DEC C that died a natural death some years ago.

9 years agoA malloc cast in vms/vms.c.
Craig A. Berry [Thu, 5 Jun 2014 20:42:34 +0000 (15:42 -0500)]
A malloc cast in vms/vms.c.

C didn't notice this with standard warnings enabled, but C++ takes
vengeance, so cast appropriately.

9 years agowcs* fix-up for configure.com
Craig A. Berry [Thu, 5 Jun 2014 20:30:08 +0000 (15:30 -0500)]
wcs* fix-up for configure.com

VMS has had wcscmp and wcsxfrm since version 6.2 was released in
1995.  None of these functions depends on what compiler we're
running, only on what the C library has, and there is only one
viable CRTL in existence in modern times, so we probably need a
further refactor to eliminate the compiler check for this whole
section.

9 years agoupdate release schedule
Ricardo Signes [Thu, 5 Jun 2014 18:28:23 +0000 (14:28 -0400)]
update release schedule

9 years agot/run/locale.t: Remove unnecessary setlocales()
Karl Williamson [Wed, 4 Jun 2014 01:46:19 +0000 (19:46 -0600)]
t/run/locale.t: Remove unnecessary setlocales()

The locale is supposed to be passed in via the environment.  There is no
need to also set it explicitly.

9 years agoFix Windows ctype functions
Karl Williamson [Wed, 4 Jun 2014 01:37:45 +0000 (19:37 -0600)]
Fix Windows ctype functions

Windows doesn't follow the Posix standard for their functions like
isalnum(), isdigit(), etc.  This forces compliance by changing the
macros that are the interfaces to those functions to be smarter than
just calling the raw functions.

9 years agoRevert "PATCH: [perl #119499] "$!" with UTF-8 flag"
Karl Williamson [Wed, 4 Jun 2014 00:39:40 +0000 (18:39 -0600)]
Revert "PATCH: [perl #119499] "$!" with UTF-8 flag"

This reverts commit b17e32ea3ba5ef7362d2a3d1a433661afb897786.

With this commit, the stringification of $! will have the UTF-8 flag set
when the text is actually non-ASCII UTF-8.  The reverted commit itself
reverted code that was to fix bugs with this discrepancy of the UTF-8
flag, but which caused backward-compatibility problems with existing
code.

Several things have happened in the interim which allows us to
experimentally resotre the previously reverted changes.  One is that
this is early in the 5.21 cycle, and we have plenty of time to see what
negative consequences this may cause.  Two is that the returned text
will only be in UTF-8 if the stringification happens within the scope of
'use locale'.  This means that the negative effects won't happen for
code, like ack, that is otherwise locale unaware.  Third, the 'locale'
pragma has been enhanced to allow the program to only have locale
awareness of LC_MESSAGES.

Code that needs to continue the 5.20 and earlier behavior can do the
stringification within the scopes of both 'use bytes' and 'use locale
":messages".  No other Perl operations will be affected by locale; only
$! and $^E stringification.  The 'bytes' pragma causes the UTF-8 flag to
not be set, just as in previous Perl releases.

9 years agoUse C locale for "$!" ouside 'use locale' scope
Karl Williamson [Mon, 2 Jun 2014 21:56:05 +0000 (15:56 -0600)]
Use C locale for "$!" ouside 'use locale' scope

The stringification of $! has long been an outlier in Perl locale
handling.  The theory has been that these operating system messages are
likely to be of use to the final user, and should be in their language.
Things like
    No space left on device
    Can't fork
are not something the program is likely to handle, but could be
meaningfully helpful to the end-user.

There are problems with this though.  One is that many perl messages are
in English, with the $! appended to them, so that the resultant message
is of mixed language, and may need to be translated anyway.  Things like
    No space left on device
probably won't need the remaining portion of the message to give someone
a clear indication as to what's wrong.  But there are many other
messages where both the OS error and the Perl error would be needed
togther to understand the problem.  An on-line translation tool can be
used to do this.

Another problem is that it can lead to garbage coming out on the user's
terminal when the program is not expecting UTF-8, but the underlying
locale is UTF-8.  This is what happens in Bug #112208, and another that
was merged with it.  It's a lot harder to translate mojibake via an
online tool than English.

This commit solves that by using the C locale for messages, except
within the scope of 'use locale'.  It is extremely likely that the
messages in the C locale will be English, but if not they will be ASCII,
and there will be no garbage printed.  A program that says "use locale"
is indicating that it has the intelligence necessary to deal with
locales.

9 years agoData::Dumper: Fix wrong #if
Karl Williamson [Mon, 2 Jun 2014 21:00:05 +0000 (15:00 -0600)]
Data::Dumper: Fix wrong #if

The code being conditionally compiled is for LC_COLLATE, not LC_NUMERIC

9 years agoAdd parameters to "use locale"
Karl Williamson [Mon, 2 Jun 2014 20:49:30 +0000 (14:49 -0600)]
Add parameters to "use locale"

This commit allows one to specify to enable locale-awareness for only a
specified subset of the locale categories.  Thus you could make a
section of code LC_MESSAGES aware, with no locale-awareness for the
other categories.

9 years agonumeric.c: Remove unnecessary test
Karl Williamson [Mon, 2 Jun 2014 19:52:38 +0000 (13:52 -0600)]
numeric.c: Remove unnecessary test

The second test won't be true unless the first one is (but not vice
versa), so no need to test the first.

9 years agoop.c: Use macro instead of its expansion
Karl Williamson [Mon, 2 Jun 2014 18:15:47 +0000 (12:15 -0600)]
op.c: Use macro instead of its expansion

It's better to use a pre-defined macro when available.  This isn't quite
the same, as the macro is valid for both run-time and compile-time and
the code is only compile-time.  In the unlikely event that  this were
ever to be found to be other than negligible, a compile-time-only
version of the macro could be created.

9 years agoAllow dynamic lock of LC_NUMERIC
Karl Williamson [Mon, 2 Jun 2014 02:07:30 +0000 (20:07 -0600)]
Allow dynamic lock of LC_NUMERIC

When processing version strings, the radix character must be a dot even
if we otherwise would be using some other character.  vutil.c
upg_version() changes to the dot, but calls sv_catpvf() which may try to
change the character to something else.  This commit introduces a way to
lock the character to a dot around the call to sv_catpvf()

vutil.c is cpan-upstream, but already blead and cpan have diverged, so
this just updates the SHA of the new version

9 years agoFix up LC_NUMERIC wrap macros
Karl Williamson [Mon, 2 Jun 2014 01:40:12 +0000 (19:40 -0600)]
Fix up LC_NUMERIC wrap macros

perl.h has some macros used to manipulate the locale exposed for the
category LC_NUMERIC.  These are currently undocumented, but will need to
be documented as the development of 5.21 progresses.  This fixes these
up in several ways:

The tests for if we are in the correct state are made into macros.  This
is in preparation for the next commit, which will make one of them more
complicated, and so that complication will only have to be in one place.

The variable declared by them is renamed to be preceded by an
underscore.  It is dangerous practice to have a name used in a macro, as
it could conflict with a name used by outside code.  This alleviates it
somewhat by making it even less likely to conflict.  This will have to
be revisited when some of these macros are made part of the public API.

The tests to see if things need to change are reversed.  Previously we
said we need to change to standard, for example, if the variable for
'local' is set.  But both can be true at the same time if the underlying
locale is C.  In this case, we only need to change if we aren't in
standard.  Whether that is also local is irrelevant.

9 years agoKeep LC_NUMERIC in C locale, except for brief periods
Karl Williamson [Sun, 1 Jun 2014 20:05:48 +0000 (14:05 -0600)]
Keep LC_NUMERIC in C locale, except for brief periods

This is for XS modules, so they don't have to worry about the radix
being a non-dot.  When the locale needs to be in the underlying one, the
operation should be wrapped using macros for the purpose.  That API may
change as we gain experience in 5.21, so I'm not including it now.

9 years agonumeric.c: White-space only
Karl Williamson [Sun, 1 Jun 2014 22:05:20 +0000 (16:05 -0600)]
numeric.c: White-space only

The previous commit added a block around this code, so indent
correspondingly.

9 years agoMake sure locale set right for radix parsing
Karl Williamson [Sun, 1 Jun 2014 22:02:24 +0000 (16:02 -0600)]
Make sure locale set right for radix parsing

I haven't found a test case this fails for in v5.20, but I'm sure there
is one.  But two commits from now would fail if this wasn't done.

9 years agoperllocale: Wrap some text in C<...>
Karl Williamson [Mon, 2 Jun 2014 00:07:34 +0000 (18:07 -0600)]
perllocale: Wrap some text in C<...>

9 years agoAvoid locale function overhead
Karl Williamson [Sun, 1 Jun 2014 19:42:31 +0000 (13:42 -0600)]
Avoid locale function overhead

For the LC_NUMERIC locale category, one can swap between setlocale being
to "C" or to the underlying locale.  Perl keeps track of the state
using two boolean variables.  By testing these before calling the swap
functions, we can skip calling them if the current state is the one we
want to be in, and avoid the function call overhead, as the function
becomes a no-op if the current state is the desired one.

9 years ago'use locale' no longer ever fails.to compile
Karl Williamson [Fri, 16 May 2014 03:18:14 +0000 (21:18 -0600)]
'use locale' no longer ever fails.to compile

Thus we can skip the machinations we used to do to make sure things
compiled.

9 years agoSet utf8 flag properly in localeconv
Karl Williamson [Fri, 16 May 2014 01:29:41 +0000 (19:29 -0600)]
Set utf8 flag properly in localeconv

 Rare, but not unheard of, is for the strings returned by localeconv to
 be in UTF-8.  This commit looks for and sets the UTF-8 flag if they are.
 so encoded.

 A private function had to changed from static for this.  It is renamed
 to begin with an underscore to emphasize its private nature.

9 years agoExclude undefined hash elements from localeconv()
Karl Williamson [Fri, 16 May 2014 00:30:37 +0000 (18:30 -0600)]
Exclude undefined hash elements from localeconv()

A given platform may not have all the localeconv elements available, or
Perl may be compiled to not use them.  Don't define hash elements for
the missing ones.

9 years agoSwap #if sense for localeconv()
Karl Williamson [Fri, 16 May 2014 00:13:08 +0000 (18:13 -0600)]
Swap #if sense for localeconv()

When the else clause is trivial, and the if clause is long, It's far easier to understand if they're swapped
so the short clause and the else are right after the if.

9 years agoLocaleconv() should be independent of 'use locale'
Karl Williamson [Thu, 15 May 2014 21:40:51 +0000 (15:40 -0600)]
Localeconv() should be independent of 'use locale'

localeconv() should return the values for the underlying locale of
the program regardless of whether the calling place is within the
scope of "use locale" or not.  Otherwise, it makes no sense to call it
from outside such scope, and a pure perl module that calls it on behalf
of a caller would likely get it wrong.

In earlier versions of Perl the LC_NUMERIC category was initialized to
C, but was changed by the first setlocale() anywhere in the process.  It
is rare to call localeconv() without first having done a setlocale().
But to solve other bugs, future commits will keep LC_NUMERIC in the C
locale except during such operations where it should be the underlying
locale.  localeconv() is such a place, so this commit is being done
before the later ones so it doesn't break.

9 years agoperl.h: Move #if
Karl Williamson [Mon, 2 Jun 2014 20:56:51 +0000 (14:56 -0600)]
perl.h: Move #if

Some of the things in its scope should be defined even if we don't want
to use LC_NUMERIC.  That there have been no reports of compilation
failures from the field indicates that the Configure to exclude it
hasn't been used.

9 years agoUpdate Scalar-List-Utils to CPAN version 1.39
Chris 'BinGOs' Williams [Thu, 5 Jun 2014 15:16:27 +0000 (16:16 +0100)]
Update Scalar-List-Utils to CPAN version 1.39

  [DELTA]

1.39 -- 2014/06/05 15:54:59
  [CHANGES]
   * Have pairs() return blessed objects that recognise ->key and
     ->value as well as being two-element ARRAYs
   * Booleanise the result of looks_like_number() so as not to
     accidentally leak abstraction (RT94806)
   * Document the version each function was added in (RT96220)

  [BUGFIXES]
   * Try to preserve UV precision in sum() where possible (RT95902)
   * Document known lexical capture in pairmap bug RT95409
   * SvGETMAGIC() in set_prototype() (RT72080)

9 years agowhen unCOWing a string, set SvCUR to 0
David Mitchell [Thu, 5 Jun 2014 14:03:32 +0000 (15:03 +0100)]
when unCOWing a string, set SvCUR to 0

When a COW string is unCOWed, as well as setting SvPVX to NULL and SvLEN
to 0, set SvCUR to 0 too.

This is to avoid a later SvGROW on the same using the old SvCUR() value
to calculate a roundup to the buffer size.

Consider the following code:

    use Devel::Peek;
    for (1..3) {
        my $t;
        my $s = 'x' x 100;
        $t = $s;
        Dump $s;
    }

Looking at the LEN line of the Dump output, we got on 5.20.0:

  LEN = 102
  LEN = 135
  LEN = 135

and after this commit,

  LEN = 102
  LEN = 102
  LEN = 102

As well as wasting space, this extra LEN was then triggering the 'skip COW
if LEN >> CUR' mechanism, causing extra copies. See:

    [perl #121977] COWification seems expensive in PADMY variables

9 years agoEnable new wcs variables for Win32
H.Merijn Brand [Thu, 5 Jun 2014 10:42:12 +0000 (12:42 +0200)]
Enable new wcs variables for Win32

9 years agoprevent double single quotes for default cfg vars
H.Merijn Brand [Thu, 5 Jun 2014 10:28:37 +0000 (12:28 +0200)]
prevent double single quotes for default cfg vars

9 years agoundoubled bad quoting
H.Merijn Brand [Thu, 5 Jun 2014 10:21:04 +0000 (12:21 +0200)]
undoubled bad quoting

9 years agoProbe for working wcscmp and wcsxfrm
H.Merijn Brand [Mon, 2 Jun 2014 15:11:05 +0000 (17:11 +0200)]
Probe for working wcscmp and wcsxfrm

9 years agoThere's no UVdf, there is UVuf. (#if 0'ed code)
Jarkko Hietaniemi [Thu, 5 Jun 2014 00:58:06 +0000 (20:58 -0400)]
There's no UVdf, there is UVuf. (#if 0'ed code)

9 years agoBring a long line in threads.pm under 80 cols
kafka [Wed, 14 May 2014 16:10:49 +0000 (18:10 +0200)]
Bring a long line in threads.pm under 80 cols

For: https://rt.perl.org/Ticket/Display.html?id=121873

9 years agoevat => eval as found by Tom Hukins
H.Merijn Brand [Wed, 4 Jun 2014 07:07:24 +0000 (09:07 +0200)]
evat => eval as found by Tom Hukins

9 years agoDisallow omitting % and @ on hash and array names
Dagfinn Ilmari Mannsåker [Fri, 9 May 2014 23:04:58 +0000 (00:04 +0100)]
Disallow omitting % and @ on hash and array names

Really old Perl let you omit the @ on array names and the % on hash
names in some spots.  This has issued a deprecation warning since Perl
5.0, and is no longer permitted.

9 years agoBring all lines in CoreList.pod under 80 cols
kafka [Tue, 13 May 2014 20:26:41 +0000 (22:26 +0200)]
Bring all lines in CoreList.pod under 80 cols

9 years agorefactor pp_tied
Daniel Dragan [Tue, 27 May 2014 21:14:20 +0000 (17:14 -0400)]
refactor pp_tied

remove some redundant code regarding stack handling

-removed:
  -4/-8 pop on SP
  +4/+8 push on SP
  PUTBACK

function's machine code size dropped from 0xC5 to 0xBD bytes on VC2003

9 years agoCorrect heading level of perllexwarn changes summary
Thomas Sibley [Tue, 3 Jun 2014 06:24:12 +0000 (23:24 -0700)]
Correct heading level of perllexwarn changes summary

It was a =head2 in a sea of =head3s.

9 years agoReduce env var calls to one in ExtUtils::Install
Chris 'BinGOs' Williams [Tue, 3 Jun 2014 21:51:20 +0000 (22:51 +0100)]
Reduce env var calls to one in ExtUtils::Install

9 years agoUpgrade Module::Metadata from version 1.000023 to 1.000024
Steve Hay [Tue, 3 Jun 2014 21:33:28 +0000 (22:33 +0100)]
Upgrade Module::Metadata from version 1.000023 to 1.000024

9 years agoAdd quietening env var option to pm_to_blib in ExtUtils::Install
Chris 'BinGOs' Williams [Tue, 3 Jun 2014 20:16:48 +0000 (21:16 +0100)]
Add quietening env var option to pm_to_blib in ExtUtils::Install

9 years ago375ed12a broke Config::IniFiles
Jarkko Hietaniemi [Tue, 3 Jun 2014 12:41:34 +0000 (08:41 -0400)]
375ed12a broke Config::IniFiles

... among other things: https://rt.perl.org/Ticket/Display.html?id=122021

PerlIO::scalar (aka opening scalars for IO) has fileno of -1.

This (and probably other exotic PerlIO objects which have funny fds)
requires special care.

9 years ago38d96942 missed a side-effect in PerlIO_open flags parsing.
Jarkko Hietaniemi [Mon, 2 Jun 2014 13:57:28 +0000 (09:57 -0400)]
38d96942 missed a side-effect in PerlIO_open flags parsing.

The mode++ was essential in allowing 'rb' for the PerlIO_open() flags.
Without the mode++ the 'b' was left unprocessed and this caused
the oflags to become bogus.

Compress::Bzip2 caught this: https://rt.perl.org/Ticket/Display.html?id=122012
(also Unicode::Map8, Text::Scan, and otehrs)

While doing this, realized that for the "O_BINARY versus O_TEXT" it's
probably the clearest to test for the non-zero-ness of those two flags.

(Is there any "unit testing" of PerlIO? In this case it would be:
 PerlIO_open -> PerlIO_openn -> PerlIOBuf_open -> PerlIOUnix_open ->
 PerlIOUnix_oflags with mode of "rb")

9 years agoperl.h: move PERL_GET_CONTEXT fallbacks earlier
David Mitchell [Tue, 3 Jun 2014 09:06:20 +0000 (10:06 +0100)]
perl.h: move PERL_GET_CONTEXT fallbacks earlier

A recent commit added a 'dTHX' to inline.h for the first time;
this broke -DPERL_GLOBAL_STRUCT* builds.

The fix is to move the 'fallback' definitions in perl.h, such as

    #ifndef PERL_GET_CONTEXT
    #  define PERL_GET_CONTEXT             PERL_GET_INTERP

to earlier in the file so that they come before

    #include "inline.h"

9 years agoFix 2 overlong verbatim lines in Hash::Util
Karl Williamson [Mon, 2 Jun 2014 19:35:13 +0000 (13:35 -0600)]
Fix 2 overlong verbatim lines in Hash::Util

And regenerate known issues to not warn about the rest

9 years agoUpdate Porting/Maintainers.pl for Devel-PPPort upgrade in ea4b7f3223
Steve Hay [Mon, 2 Jun 2014 17:42:01 +0000 (18:42 +0100)]
Update Porting/Maintainers.pl for Devel-PPPort upgrade in ea4b7f3223

Also remove all the IGNORABLE files. These are not required in core for
cpan/ distributions; we save space by leaving them out. And we don't want
EXCLUDED files either.

9 years agoRemove undefined Makefile.SH 'translators' target for x2p.
Andy Dougherty [Mon, 2 Jun 2014 16:48:48 +0000 (12:48 -0400)]
Remove undefined Makefile.SH 'translators' target for x2p.

Since x2p has been removed, there is no translators target in the
Makefile, but it was still referenced in some definitions.  This was a
fatal error for Solaris make.

9 years agotemporary fix for https://rt.cpan.org/Ticket/Display.html?id=96126
Tony Cook [Mon, 2 Jun 2014 13:12:35 +0000 (23:12 +1000)]
temporary fix for https://rt.cpan.org/Ticket/Display.html?id=96126

9 years agoUpgrade Module-Metadata from version 1.000022 to 1.000023
Steve Hay [Mon, 2 Jun 2014 12:25:54 +0000 (13:25 +0100)]
Upgrade Module-Metadata from version 1.000022 to 1.000023

9 years agoperldelta for 207c4a46d1
Steve Hay [Mon, 2 Jun 2014 12:09:14 +0000 (13:09 +0100)]
perldelta for 207c4a46d1

9 years agoBump Locale-Codes from 3.30 to 3.31
Sullivan Beck [Wed, 28 May 2014 15:45:59 +0000 (11:45 -0400)]
Bump Locale-Codes from 3.30 to 3.31

9 years agox2p is gone, do not install its pod.
Jarkko Hietaniemi [Mon, 2 Jun 2014 12:53:04 +0000 (08:53 -0400)]
x2p is gone, do not install its pod.

9 years agoUse PERL_UNUSED_RESULT.
Jarkko Hietaniemi [Sat, 31 May 2014 20:56:00 +0000 (16:56 -0400)]
Use PERL_UNUSED_RESULT.

(1) Enhance its description.
(2) Simplify it: define only if has warn_unused_result.
(3) Make it use STMT_START { ... } STMT_END to be less GNU-extensiony.
(4) Redo 04783dc7 ("fix 'ignoring return value' compiler warnings") with it.

9 years agoremove intentional leak in win32/win32.c ansify_path
Daniel Dragan [Mon, 19 May 2014 23:45:41 +0000 (19:45 -0400)]
remove intentional leak in win32/win32.c ansify_path

The leak for was workaround for a bug (feature?) of Borland RTL where
putenv kept the passed in pointer, see commit 3e5d884e5e .
Borland was removed so this goes too. Leak found with Dr Memory.
msvcrt.dll from WinXP SP3 does not leak on a call to putenv, static linked
CRT from VC6 was confirmed to leak.

9 years agoregcomp.c - cleanup the ahocorasick start class logic so it more self-documenting
Yves Orton [Sat, 19 Apr 2014 12:42:47 +0000 (14:42 +0200)]
regcomp.c - cleanup the ahocorasick start class logic so it more self-documenting

The logic of setting up an AHO-CORASICK regex start class was not fully
encapsuated in the make_trie_failtable() function, which itself was
poorly named. Merged the code into make_trie_failtable() and renamed
it to construct_ahocorasick_from_trie().

9 years agoHash::Util - fixes to hash stats and add bucket_stats_formatted()
Yves Orton [Sun, 13 Apr 2014 11:29:44 +0000 (13:29 +0200)]
Hash::Util - fixes to hash stats and add bucket_stats_formatted()

* we should do the mean/stddev on the on the occupied buckets not all buckets.

This was always intended to the be average chain-length, which implies
that empty buckets with no-chains at all are excluded.

* Add bucket_stats_formatted(), bump version

Creates reports like this:

    Keys: 500 Buckets: 314/512 Quality-Score: 1.01 (Good)
    Utilized Buckets: 61.33% Optimal: 97.66% Keys In Collision: 37.20%
    Chain Length - mean: 1.59 stddev: 0.81
    Buckets 512         [0000000000000000000000000111111111111111111111122222222222233334]
    Len   0 Pct:  38.67 [#########################]
    Len   1 Pct:  34.57 [######################]
    Len   2 Pct:  19.53 [############]
    Len   3 Pct:   5.47 [####]
    Len   4 Pct:   1.17 [#]
    Len   5 Pct:   0.59 []
    Keys    500         [1111111111111111111111111111111111111111222222222222222222333334]
    Pos   1 Pct:  62.80 [########################################]
    Pos   2 Pct:  27.40 [##################]
    Pos   3 Pct:   7.40 [#####]
    Pos   4 Pct:   1.80 [#]
    Pos   5 Pct:   0.60 []

* Make it possible to get stats on PL_strtab

* bump version to 0.17

9 years agohv_func.h - fix seed initialization in sdbm and djb2 hashing algorithms.
Yves Orton [Sun, 13 Apr 2014 10:54:12 +0000 (12:54 +0200)]
hv_func.h - fix seed initialization in sdbm and djb2 hashing algorithms.

In a previous commit I added code to "mix in" the length of the
string into the seed used by these functions, to avoid issues with
zero seeds, and with the hope that it makes it harder to create
multicollision attacks against these hash functions.

Unfortunately when I restructured the seed logic for the inline
functions in hv_func.h I messed it up, and these hash functions
were broken. I never noticed because they are both such bad hash
functions for our needs that I never built with them, and we have
no infrastructure to make it easy to test building with non-standard
hash functions so it never got automatically tested. Hopefully
at some point someone will find a round-tuit and teach Configure
about selecting alternate hash functions.

9 years agouniversal.c - utf8::downgrade($x,FAIL_OK) is not supposed to treat FAIL_OK as an...
Yves Orton [Fri, 21 Mar 2014 16:47:45 +0000 (17:47 +0100)]
universal.c - utf8::downgrade($x,FAIL_OK) is not supposed to treat FAIL_OK as an integer

9 years agot/loc_tools.pl: Clarify comment
Karl Williamson [Fri, 16 May 2014 03:25:32 +0000 (21:25 -0600)]
t/loc_tools.pl: Clarify comment

9 years agoperllocale: Wrap some text in C<...>
Karl Williamson [Sun, 1 Jun 2014 20:03:53 +0000 (14:03 -0600)]
perllocale: Wrap some text in C<...>

9 years agoregcomp.c: Skip work that is a no-op
Karl Williamson [Sun, 11 May 2014 23:41:48 +0000 (17:41 -0600)]
regcomp.c: Skip work that is a no-op

There are a few characters in the Latin1 range that can be folded to by
above-Latin1 characters.  Some of these are folded to as part of a
single character fold, like KELVIN SIGN folds to 'k'.  More are folded
to as part of a multi-character fold.  Until this commit, there wasn't a
quick way to distinguish between the two classes.  A couple of places
only want the single-character ones.  It is more efficient to look for
just those than to include the multi-char ones which end up not doing
anything.  This uses a bit in l1_char_class_tab.h to indicate those
characters that are in the desired class.

9 years agoregcomp.c: Update comment to new reality
Karl Williamson [Mon, 12 May 2014 00:20:54 +0000 (18:20 -0600)]
regcomp.c: Update comment to new reality

9 years agoUpdate Socket to CPAN version 2.014
Chris 'BinGOs' Williams [Sun, 1 Jun 2014 10:30:21 +0000 (11:30 +0100)]
Update Socket to CPAN version 2.014

  [DELTA]

2.014   2014/06/01 00:09:13
        [BUGFIXES]
         * Make sure to (UV)-cast arguments sprintf'ed with UVf
         * Use STRUCT_OFFSET() instead of plain C99 offsetof() (RT96036)
         * Fix the regexp used to filter for numeric IP addresses in
           fake_getaddrinfo() (RT95758)
         * Protect against getprotobyname() not being available (RT90217)

9 years agoUpdate Digest-SHA to CPAN version 5.92
Chris 'BinGOs' Williams [Sun, 1 Jun 2014 10:29:00 +0000 (11:29 +0100)]
Update Digest-SHA to CPAN version 5.92

  [DELTA]

5.92  Sun Jun  1 00:15:44 MST 2014
  - fixed reserved-word clash when compiling with C++
    -- use 'classname' instead of 'class'
      -- ref. SHA.xs (rt.cpan.org #96090)
  - silenced MSC compiler warning about signed/unsigned comparison
    -- ref. SHA.xs (rt.cpan.org #95830)

5.91  Fri May 16 10:21:44 MST 2014
  - restored original 'addfile' for use on opened file handles
    -- allows callbacks in place of actual files
      -- ref. IO::Callback (rt.cpan.org #95643)
  - re-established inheritance from Digest::base
    -- to pick up future Digest enhancements automatically
  - cleaned up documentation

5.90  Wed May  7 07:57:08 MST 2014
  - consolidated all dynamic memory allocation into XSUBs
    -- streamlines referencing of SHA objects
    -- simplifies DESTROYing of objects
  - enhanced Makefile.PL to allow 'use warnings'
    -- automatically reverts to $^W for early Perls
  - scrubbed C and Perl code to remove all compiler warnings

5.89  Sat Apr 19 05:14:48 MST 2014
  - added universal newlines mode ("U") to addfile and shasum
    -- based on Python Universal Newlines concept
      -- newlines identical across MacOS, DOS, and UNIX
    -- will deprecate portable mode ("p") in future
      -- "U" mode is cleaner and more efficient
  - enhanced performance
    -- reduced number of dynamic memory allocations
    -- sped up addfile method with use of C code
      -- ref. SHA.xs (_addfilebin and _addfileuniv)
  - eliminated experimental -M option in favor of new -R option
    -- reverses order of digest module preference
    -- undocumented: for test and development use only
  - sealed memory leak in SHA.xs
    -- arose only with SvPVbyte exceptions during eval
  - patched inheritence bug (ref: rt.cpan.org #94830)
    -- use sv_isobject/sv_derived_from instead of sv_isa
  - added 'allocated' flag to SHA structure (ref. src/sha.h)
    -- to guard against Perl double frees

9 years agoRegen META files after CPAN-Meta update
Chris 'BinGOs' Williams [Sun, 1 Jun 2014 10:26:30 +0000 (11:26 +0100)]
Regen META files after CPAN-Meta update

9 years agoUpdate CPAN-Meta to CPAN version 2.141520
Chris 'BinGOs' Williams [Sun, 1 Jun 2014 10:22:45 +0000 (11:22 +0100)]
Update CPAN-Meta to CPAN version 2.141520

  [DELTA]

2.141520  2014-05-31 23:41:13-04:00 America/New_York

  [DOCUMENTED]

  - Clarified use of 'file' for the 'provides' field in the Spec

9 years agoregen for removed Configure symbol
Tony Cook [Sun, 1 Jun 2014 10:12:21 +0000 (20:12 +1000)]
regen for removed Configure symbol

9 years agoremove BOOTSTRAP_CHARSET from Configure (khw's request)
H.Merijn Brand [Sun, 1 Jun 2014 09:39:45 +0000 (11:39 +0200)]
remove BOOTSTRAP_CHARSET from Configure (khw's request)

9 years agorun/locale.t: Add explanation for when tests fail
Karl Williamson [Wed, 14 May 2014 02:55:09 +0000 (20:55 -0600)]
run/locale.t: Add explanation for when tests fail

Commit ff4377fe256e32a3bc10175c01dd6c68c9ce7ddb silenced some irrelevant
warnings that occur from some sh programs on some systems.  It does this
by closing STDERR.  That is fine unless the test fails.  This commit
changes things so that a failure now outputs a diagnostic note about how
to see the test failure details.

It would be better to automaticallty rerun the test with STDERR open
when this happens, but that is more effort than it's worth IMO, given
the likely rarity of the failures here.

9 years agorun/locale.t: Remove redundant block
Karl Williamson [Wed, 14 May 2014 02:53:11 +0000 (20:53 -0600)]
run/locale.t: Remove redundant block

This has { { foo } }
Only one level is necessary. outdents.

9 years agoperlebcdic: Nit, and remove obsolete text
Karl Williamson [Sun, 1 Jun 2014 03:08:55 +0000 (21:08 -0600)]
perlebcdic: Nit, and remove obsolete text

This pod is now in UTF-8 encoding.

9 years agoperlebcdic: Clean-up
Karl Williamson [Sat, 31 May 2014 23:11:10 +0000 (17:11 -0600)]
perlebcdic: Clean-up

There are much simpler ways to do some things than were given.  This
also makes some clarifications, and removes obsolete text, shortens some
too long verbatim lines.

9 years agoutfebcdic.h: Add comments
Karl Williamson [Sat, 31 May 2014 23:09:53 +0000 (17:09 -0600)]
utfebcdic.h: Add comments

9 years agoPATCH: [perl #120386]: av_len documentation
Karl Williamson [Fri, 15 Nov 2013 20:40:03 +0000 (13:40 -0700)]
PATCH: [perl #120386]: av_len documentation

I think I have incorporated everybody's concerns in this patch.

9 years agolib/utf8.pm: Document unicode_to_native() and inverse
Karl Williamson [Tue, 15 Oct 2013 04:58:30 +0000 (22:58 -0600)]
lib/utf8.pm: Document unicode_to_native() and inverse

9 years agolib/utf8.pm: wrap code examples in pod with C<>
Karl Williamson [Tue, 15 Oct 2013 04:38:24 +0000 (22:38 -0600)]
lib/utf8.pm: wrap code examples in pod with C<>

9 years agolib/locale.t: Add tests, fix test names
Karl Williamson [Sat, 31 May 2014 20:27:54 +0000 (14:27 -0600)]
lib/locale.t: Add tests, fix test names

It is unfortunate that tests are in two places in this file.  The reason
is to avoid doing eval's (to avoid any perturbations that might cause)
but be under the scope of two different locale forms.  This adds text to
remind maintainers that they should create copies when adding tests, and
includes the new tests that have previously been added to one place but
not the other, and includes the new improved test names.

9 years agolib/locale.t: Add some tests
Karl Williamson [Sat, 31 May 2014 20:11:35 +0000 (14:11 -0600)]
lib/locale.t: Add some tests

9 years agolib/locale.t: Improve test names; add some names
Karl Williamson [Sat, 31 May 2014 20:10:00 +0000 (14:10 -0600)]
lib/locale.t: Improve test names; add some names

9 years agosv.c: Add comment
Karl Williamson [Sat, 31 May 2014 18:45:41 +0000 (12:45 -0600)]
sv.c: Add comment

9 years agoFix definition of toCTRL() for EBCDIC
Karl Williamson [Tue, 13 May 2014 00:29:41 +0000 (18:29 -0600)]
Fix definition of toCTRL() for EBCDIC

The definition was incorrect.  When going from control to printable
name, we need to go from Latin1 -> Native, so that e.g., a 65 gets
turned into the native 'A'

9 years agoAdd some (UN)?LIKELY() to UTF8 handling
Karl Williamson [Tue, 6 May 2014 19:18:28 +0000 (13:18 -0600)]
Add some (UN)?LIKELY() to UTF8 handling

It's very rare actually for code to be presented with malformed UTF-8,
so give the compiler a hint about the likely branches.

9 years agoMove some deprecated utf8-handling functions to mathoms
Karl Williamson [Tue, 6 May 2014 04:46:48 +0000 (22:46 -0600)]
Move some deprecated utf8-handling functions to mathoms

This entailed creating new internal functions for some of them to call
so that the functionality can be retained during the deprecation period.

9 years agoMake is_utf8_char_buf() a macro
Karl Williamson [Tue, 6 May 2014 04:41:14 +0000 (22:41 -0600)]
Make is_utf8_char_buf() a macro

This function is now more efficiently implemented as a synonym for
isUTF8_CHAR().  We retain the Perl_is_utf8_char_buf() function for code
that calls it that way.

9 years agoutf8.h: Use new macro type from previous commit
Karl Williamson [Tue, 6 May 2014 04:17:33 +0000 (22:17 -0600)]
utf8.h: Use new macro type from previous commit

This allows for an efficient isUTF8_CHAR macro, which does its own
length checking, and uses the UTF8_INVARIANT macro for the first byte.
On EBCDIC systems this macro which does a table lookup is quite a bit
more efficient than all the branches that would normally have to be
done.

9 years agoregen/regcharclass.pl: Add new macro type with intermed checking
Karl Williamson [Tue, 6 May 2014 03:09:36 +0000 (21:09 -0600)]
regen/regcharclass.pl: Add new macro type with intermed checking

This adds a new macro generation option for inputs that are checked
elsewhere for buffer overflow, but otherwise needs validity checks.

9 years agoCreate isUTF8_CHAR() macro and use it
Karl Williamson [Tue, 6 May 2014 02:43:47 +0000 (20:43 -0600)]
Create isUTF8_CHAR() macro and use it

This macro will inline the code to determine if a character is
well-formed UTF-8 for code points below a certain value, falling back to
a slower function for larger ones.  On ASCII platforms, it will inline
for well-beyond all legal Unicode code points.  On EBCDIC, it currently
does it for code points up to 0x3FFF.  This could be increased, but our
porting tests do the regen every time to make sure everything is ok, and
making it larger slows that down.  This is worked around on ASCII by
normally commenting out the code that generates this info, but including
in utf8.h a version that did get generated.  This is static information
and won't change.  (This could be done for EBCDIC too, but I chose not
to at this time as each code page has a different macro generated, and
it gets ugly getting all of them in utf8.h)

Using this macro allowed for simplification of several functions in
utf8.c

9 years agoutf8.h: Move macro within file
Karl Williamson [Tue, 6 May 2014 02:13:31 +0000 (20:13 -0600)]
utf8.h: Move macro within file

This places it in a better situated spot for later commits

9 years agoutf8.c: Move a static function to inline.h
Karl Williamson [Tue, 6 May 2014 01:37:58 +0000 (19:37 -0600)]
utf8.c: Move a static function to inline.h

This is in preparation for it being called from outside utf8.c.  It is
renamed to have a leading underscore to emphasize its private nature

9 years agoregen/regcharclass.pl: Comment, white-space only
Karl Williamson [Tue, 6 May 2014 00:59:35 +0000 (18:59 -0600)]
regen/regcharclass.pl: Comment, white-space only

This commit indents code to properly align with the new block introduced
by the previous commit, and adds a comma to a comment

9 years agoregen/regcharclass.pl: Update to use EBCDIC utilities
Karl Williamson [Tue, 6 May 2014 00:50:01 +0000 (18:50 -0600)]
regen/regcharclass.pl: Update to use EBCDIC utilities

This causes the generated regcharclass.h to be valid on all
supported platforms

9 years agoregen/regcharclass.pl: make a 'do' into a 'require'
Karl Williamson [Tue, 6 May 2014 00:14:55 +0000 (18:14 -0600)]
regen/regcharclass.pl: make a 'do' into a 'require'

This is because a future commit will execute this code multiple times,
and the library file should only be read once.

9 years agoRevert bootstrapping to non-ASCII platforms
Karl Williamson [Mon, 5 May 2014 23:16:03 +0000 (17:16 -0600)]
Revert bootstrapping to non-ASCII platforms

This effectively reverts commit 3ded5eb052cdc3f861ec0c0ff85348086d653be0.

That commit created a scheme to bootstrap Perl onto a non-ASCII
platform, by adding the allowing a Configure option that caused the
compiled code to bypass a number of normal macro definitions and use
slower, generic ones, sufficient to get miniperl to compile on the
target architecture.  One would then use miniperl to run a few scripts
that would re-order certain header files,  Using this one could then
recompile all of perl, and once that was done, use it to recompile to
use the normal fast macros.

This worked, but was a cumbersome process.  We now have the
infrastructure, since commit 6ff677df5d6fe0f52ca0b6736f8b5a46ac402943,
to cross compile on an ASCII platform to EBCDIC, the likely only
non-ASCII character set to ever be used.  So the new infrastructure will
be used in future commits.

9 years agoRevert "regen/regcharclass.pl: Make more EBCDIC-friendly"
Karl Williamson [Mon, 5 May 2014 22:30:10 +0000 (16:30 -0600)]
Revert "regen/regcharclass.pl: Make more EBCDIC-friendly"

This reverts commit c4c8e61502fd5289a080f20332c6e3f9f23ce6e2.

It turns out that this scheme to bootstrap regcharclass.h onto a machine
not running ASCII created too much manual labor getting things to work.
A better solution is to cross compile on an ASCII machine for the
target.  Commit 6ff677df5d6fe0f52ca0b6736f8b5a46ac402943 created the
infrastructure to do that, and this commit starts the process of
changing regen/regcharclass.pl to use that.

9 years agoregen/regcharclass_multi_char_folds.pl: Don't do unnecessary work
Karl Williamson [Tue, 29 Apr 2014 00:03:02 +0000 (18:03 -0600)]
regen/regcharclass_multi_char_folds.pl: Don't do unnecessary work

This bit code is not about just ASCII folds, so skip it when doing just
those.

9 years agoregen/mk_invlists.pl: Remove unnecessary #if's
Karl Williamson [Mon, 28 Apr 2014 23:52:42 +0000 (17:52 -0600)]
regen/mk_invlists.pl: Remove unnecessary #if's

Even though this file is not intended to be human consumable, it is
annoying to see #if ... #endif #if ...
where the #endif and #if could be consolidated.

It turns out not to be hard to do that.