This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
2 years agore/anyof.t: Add debugging info
Karl Williamson [Wed, 23 Mar 2022 19:26:26 +0000 (13:26 -0600)]
re/anyof.t: Add debugging info

This is in response to
https://github.com/Perl/perl5/pull/19558#issuecomment-1076659884

2 years agoFix double encoding of UTF-8 on EBCDIC
Karl Williamson [Wed, 23 Mar 2022 19:31:38 +0000 (13:31 -0600)]
Fix double encoding of UTF-8 on EBCDIC

Commit d1e771d8c533168553df9b2a858d967f707fc9fe broke EBCDIC builds by
doubly encoding some UTF-8 characters.

2 years agogh17746: add missing check on hardcount
Hugo van der Sanden [Mon, 21 Mar 2022 21:55:01 +0000 (21:55 +0000)]
gh17746: add missing check on hardcount

Failing to check for max iterations caused an assertion failure.

2 years agofix typo in perl53510delta
Graham Knop [Mon, 21 Mar 2022 16:48:51 +0000 (17:48 +0100)]
fix typo in perl53510delta

2 years agoCorrect POD formatting error
James E Keenan [Mon, 21 Mar 2022 13:37:35 +0000 (13:37 +0000)]
Correct POD formatting error

Use 'F<>' for strings that are simply filenames.

As reported by Tux on #p5p.

2 years agoUpdate RMG on updateAUTHORS.pl
Sawyer X [Mon, 21 Mar 2022 10:32:29 +0000 (11:32 +0100)]
Update RMG on updateAUTHORS.pl

2 years agoUpdate Module::CoreList for 5.35.11
Sawyer X [Mon, 21 Mar 2022 10:21:08 +0000 (11:21 +0100)]
Update Module::CoreList for 5.35.11

2 years agoPerl_newSViv: simplify by using (inline) newSV_type
Richard Leach [Sun, 20 Mar 2022 19:05:10 +0000 (19:05 +0000)]
Perl_newSViv: simplify by using (inline) newSV_type

2 years agoPerl_newSVnv: simplify SV creation and SvNV_set
Richard Leach [Sun, 23 May 2021 23:33:36 +0000 (00:33 +0100)]
Perl_newSVnv: simplify SV creation and SvNV_set

The function can be simplified by using the now-inlined newSV_type
function, directly using SvNV_set, and twiddling the required flags.

This cuts out any function call overhead, a switch statement leading
to a sv_upgrade(sv, SVt_NV) call, and a touch more bit-twiddling than
is necessary.

2 years ago(perl #128245) make it obvious :encoding uses PerlIO::encoding
Tony Cook [Mon, 11 Jul 2016 00:52:20 +0000 (10:52 +1000)]
(perl #128245) make it obvious :encoding uses PerlIO::encoding

rather than encoding.pm

2 years agoBump version for 5.35.11
Sawyer X [Sun, 20 Mar 2022 18:34:19 +0000 (19:34 +0100)]
Bump version for 5.35.11

2 years agoNew perldelta for 5.35.11
Sawyer X [Sun, 20 Mar 2022 16:46:29 +0000 (17:46 +0100)]
New perldelta for 5.35.11

2 years agoTick release, update epigraph
Sawyer X [Sun, 20 Mar 2022 16:40:47 +0000 (17:40 +0100)]
Tick release, update epigraph

2 years agoAdd new release to perlhist v5.35.10
Sawyer X [Sun, 20 Mar 2022 10:35:36 +0000 (11:35 +0100)]
Add new release to perlhist

2 years agoFinalize perldelta
Sawyer X [Sun, 20 Mar 2022 10:09:28 +0000 (11:09 +0100)]
Finalize perldelta

2 years agoUpdate Module::CoreList for 5.35.10
Sawyer X [Sun, 20 Mar 2022 09:44:55 +0000 (10:44 +0100)]
Update Module::CoreList for 5.35.10

2 years agoUpdate AUTHORS file
Sawyer X [Sun, 20 Mar 2022 09:36:13 +0000 (10:36 +0100)]
Update AUTHORS file

2 years agoAdd arrows to paired string delimiters
Karl Williamson [Thu, 17 Mar 2022 23:38:55 +0000 (17:38 -0600)]
Add arrows to paired string delimiters

Unicode has lots of arrows of various shapes, sizes, and directions.
None of them were of consequence to the Bidirectional algorithm, so none
were specified as being mirrored pairs.  This commit uses the
generalizations already in place from previous commits to examine arrow
symbols and choose which are mirrored pairs.

As previously, it rejects arrows with contrary directionality, and ones
without horizontal directionality.

2 years agoAdd SPEAKERs paired delimiters
Karl Williamson [Thu, 17 Mar 2022 23:37:32 +0000 (17:37 -0600)]
Add SPEAKERs paired delimiters

The characters with this name look good as mirrored delimiters.

2 years agoAdd TELEPHONE RECEIVER paired delimiters
Karl Williamson [Thu, 17 Mar 2022 23:35:36 +0000 (17:35 -0600)]
Add TELEPHONE RECEIVER paired delimiters

The characters with this name look good as mirrored delimiters.

2 years agoAdd ERASE paired delimiters
Karl Williamson [Thu, 17 Mar 2022 23:33:08 +0000 (17:33 -0600)]
Add ERASE paired delimiters

The characters with this name look good as mirrored delimiters.

2 years agoAdd DOUBLE TRIANGLEs paired delimiters
Karl Williamson [Thu, 17 Mar 2022 23:30:47 +0000 (17:30 -0600)]
Add DOUBLE TRIANGLEs paired delimiters

The characters with this name look good as mirrored delimiters.

2 years agoAdd THREE RAYS paired delimiters
Karl Williamson [Thu, 17 Mar 2022 23:28:31 +0000 (17:28 -0600)]
Add THREE RAYS paired delimiters

The characters with this name look good as mirrored delimiters.

2 years agoAdd musical score paired delimiters
Karl Williamson [Thu, 17 Mar 2022 23:17:53 +0000 (17:17 -0600)]
Add musical score paired delimiters

The characters that signify the beginning and ending of Western music
scores serve as good delimiters

2 years agoAdd INDEX paired delimiters
Karl Williamson [Thu, 17 Mar 2022 23:11:00 +0000 (17:11 -0600)]
Add INDEX paired delimiters

The bidi-aware characters containing this word are visually suitable for
being mirrored delimiters.  The 'index' refers to the index finger
in a hand pointing at the delimited string

2 years agoAdd TURNSTILE paired delimiters
Karl Williamson [Thu, 17 Mar 2022 18:23:33 +0000 (12:23 -0600)]
Add TURNSTILE paired delimiters

The bidi-aware characters containing this word are visually suitable for
being mirrored delimiters.

2 years agoAdd TACK paired delimiters
Karl Williamson [Thu, 17 Mar 2022 18:23:12 +0000 (12:23 -0600)]
Add TACK paired delimiters

The bidi-aware characters containing this word are visually suitable for
being mirrored delimiters.

2 years agoDirectionality pres/abs-ence can mean paired delimiters
Karl Williamson [Thu, 17 Mar 2022 17:55:54 +0000 (11:55 -0600)]
Directionality pres/abs-ence can mean paired delimiters

Another way Unicode indicates that a character has horizontal
directionality is by adding LEFT or RIGHT to the name of a base
character.  Hence we get RIGHT SPEAKER vs just plain SPEAKER.

Presumably this comes about when they didn't consider directionality at
first, and then realized later it was needed.

This commit makes the script look for these kinds of character pairs.
Because the current Unicode version only has this characteristic for
Symbols, and symbols must be included explicitly, no changes in what
gets paired ensues.  But if you turn on the outputting of characters not
chosen, that list will now include things meeting this new criteria.
Less than a handful actually are like this.

2 years agounicode_constants.pl: Prepare for examining Symbols
Karl Williamson [Thu, 17 Mar 2022 16:35:00 +0000 (10:35 -0600)]
unicode_constants.pl: Prepare for examining Symbols

Heretofore, the code looking for paired string delimiters has looked at
punctuation, and a few symbols that Unicode gives a mirror for.  But
there are many more suitable-for-pairing characters in Unicode.

This commit generalizes things so as to handle the extra complexities of
the way symbols are named beyond the punctuation names.   For example,
RIGHTWARDS is sometimes used; it turns out that it also is used in one
punctuation character, which was previously overlooked by this script.

The generalization introduced by this commit handles almost all current
Unicode symbols properly.

But some symbols are barely distinguishable from their mirrors, such as
a tilde and a reversed tilde.  The scheme adopted here, then, makes the
default for a symbol pair to not be marked as paired delimiters.  The
code explicitly has to specify that a given pair is to be included.

The next few commits are mostly for adding ones that I thought were
good.

2 years agoAdd 'ELEMENT OF'/CONTAINS to paired string delimiters
Karl Williamson [Thu, 17 Mar 2022 12:27:54 +0000 (06:27 -0600)]
Add 'ELEMENT OF'/CONTAINS to paired string delimiters

This commit adds 8 pairs of symbols that are variants on ELEMENT OF
These make nice paired delimiters in the vein of < >

2 years agoAdd SUBSET/SUPERSET to paired string delimiters
Karl Williamson [Thu, 17 Mar 2022 12:20:09 +0000 (06:20 -0600)]
Add SUBSET/SUPERSET to paired string delimiters

This commit adds 20 pairs of symbols that are variants on SUBSET
These make nice paired delimiters in the vein of < >

2 years agoAdd PRECEDES/SUCCEEDS to paired string delimiters
Karl Williamson [Thu, 17 Mar 2022 12:14:46 +0000 (06:14 -0600)]
Add PRECEDES/SUCCEEDS to paired string delimiters

This commit adds 15 pairs of symbols that are variants on PRECEDES.
These look a lot like <>, so makes sense to make them paired delimiters.

2 years agoAdd SMALLER THAN to paired string delimiters
Karl Williamson [Thu, 17 Mar 2022 12:09:24 +0000 (06:09 -0600)]
Add SMALLER THAN to paired string delimiters

This commit adds 2 pairs of symbols that are variants on SMALLER THAN.
These look a lot like <>, so makes sense to make them paired delimiters.

2 years agounicode_constants.pl: Consider all \pP for delims
Karl Williamson [Wed, 9 Mar 2022 20:13:02 +0000 (13:13 -0700)]
unicode_constants.pl: Consider all \pP for delims

Previously, only the punctuation characters that Unicode had classed as
being opening/closing were considered in looking for suitable paired
delimiters.

This commit looks at all punctuation characters.  There are actually
only 7 new pairs found.

This gives us ꧁      ꧂   as string delimiterss, if your font allows,
which are Javanese and used to surround an honorific title, according to
Wikipedia.

2 years agoAdd < > variants to paired delimiters
Karl Williamson [Thu, 10 Mar 2022 16:40:10 +0000 (09:40 -0700)]
Add < > variants to paired delimiters

Perl considers '<  >' to be delimiters for strings; this commit adds
most of the Unicode variants of these to also be string delimiters.  The
ones that are combinations of both < and >, aren't included, as that
would be visually confusing.

2 years agounicode_constants.pl: Add REVERSED punctuation
Karl Williamson [Thu, 17 Mar 2022 03:11:07 +0000 (21:11 -0600)]
unicode_constants.pl: Add REVERSED punctuation

Besides LEFT/RIGHT, horizontal directionality can be specified by
Unicode in names by the presence or absence of REVERSED.

Enhancing the algorithm to take this into account adds 2 pairs or
mirrored delimiters that were previously overlooked.

2 years agounicode_constants.pl: Output why chars not chosen
Karl Williamson [Thu, 17 Mar 2022 02:03:01 +0000 (20:03 -0600)]
unicode_constants.pl: Output why chars not chosen

This script now examines all punctuation characters to see if there is a
mirrored character for it, suitable for use as a Perl string delimiter.
Some don't qualify, and some do qualify but the script doesn't catch
them.

This commit adds the ability to output which characters it doesn't think
qualify, and why.  This enables a maintainer to easily check and know
what its deficiencies are, or that there is a good reason that a
particular character gets rejected.

2 years agounicode_constants.pl: Refactor to catch more paired delims
Karl Williamson [Thu, 17 Mar 2022 01:11:08 +0000 (19:11 -0600)]
unicode_constants.pl: Refactor to catch more paired delims

Previously, only characters that Unicode included in its bidirectional
algorithm have been eligible to be found by this program to be mirrored
string delimiters.

This commit adds 5 quotation marker character pairs that
are omitted from the bidirectional algorithm, as most quotes are,
because, as the Standard says, their "directionality and pairing status
is less predictable than paired brackets."

But we're not particularly interested in those semantics, most string
delimiters will be selected only for their visual appearance.

Because they aren't in the bidi algorithm, there is no property that
maps one member of a pair to its mate. However, Two characters whose
names pair only by LEFT vs RIGHT are almost certainly a mirrored pair.
This doesn't catch all possibilities; future commits will expand the
ones caught.

The commit refactors things so as to make future commits easier which
look at even more delimiter possibilities.

2 years agoAllow reversal of some paired delimiters; deprecations
Karl Williamson [Wed, 9 Mar 2022 14:25:46 +0000 (07:25 -0700)]
Allow reversal of some paired delimiters; deprecations

Unicode says certain opening punctuation characters may be used as
closing ones in some languages; and their mirror is instead the opening
one.

This commit changes to allow either one of each such set to be the
opening one.

It also deprecates the use of any of the new mirrored delimiters to be
used outside the feature as an unmirrored delimiter, and the normal
closing delimiter from being used as an unpaired opening one while in
the feature.  This gives us the freedom to make some or all of the new
paired delimiters be reversible.

2 years agoAdd 'extra paired delimiters' feature
Karl Williamson [Mon, 14 Feb 2022 22:25:40 +0000 (15:25 -0700)]
Add 'extra paired delimiters' feature

When this feature is enabled, one can use many more string delimiters
that have an opening version and a mirrored closing one.

2 years agoregen/unicode_constants.pl: List paired delimiters
Karl Williamson [Tue, 8 Mar 2022 14:31:09 +0000 (07:31 -0700)]
regen/unicode_constants.pl: List paired delimiters

This adds the capability to temporarily change a scalar to true to cause
this to print on stderr a list of the paired string delimiters, suitable
for pasting into a pod.

2 years agounicode_constants.pl: Generate paired string delimiters
Karl Williamson [Mon, 14 Feb 2022 04:08:22 +0000 (21:08 -0700)]
unicode_constants.pl: Generate paired string delimiters

This commit causes several C strings to be generated containing bytes
that match paired string delimiters beyond the four that have
traditionally been used in Perl.  This will allow a future commit to
accept more matching delimiters around strings than those four.

The code explains how the added delimiters are chosen.

2 years agoregen/unicode_constants.pl: Extract code into a fcn
Karl Williamson [Mon, 14 Feb 2022 02:23:50 +0000 (19:23 -0700)]
regen/unicode_constants.pl: Extract code into a fcn

This is in preparation for it to be used in multiple places in a future
commit.

2 years agoregen/unicode_constants.pl: White space only
Karl Williamson [Mon, 14 Feb 2022 02:03:54 +0000 (19:03 -0700)]
regen/unicode_constants.pl: White space only

Align the output of this bit vertically with surrounding output.

2 years agotoke.c: merge loops, multi-byte delim
Karl Williamson [Sun, 13 Feb 2022 04:47:13 +0000 (21:47 -0700)]
toke.c: merge loops, multi-byte delim

The code in toke.c had two closely related loops; one for unmirrored
delimiters (same on both ends of the string) that could take UTF-8
delimiters, and one that allowed a mirrored closing delimiter, which
could take only a single byte.  I found that it was just easiest to
collapse these into one loop in preparation to allow multi-byte
mirroring.

2 years agotoke.c: white-space only
Karl Williamson [Sun, 13 Feb 2022 01:11:27 +0000 (18:11 -0700)]
toke.c: white-space only

This outdents some code that the next commit will remove an enclosing
block from

2 years agotoke.c: Rmv unnecessary conditionals
Karl Williamson [Sat, 12 Feb 2022 23:13:29 +0000 (16:13 -0700)]
toke.c: Rmv unnecessary conditionals

Cheaper to just redo a simple assignment than to test if you've already
done it and skipping it if you had.

2 years agotoke.c: Rename some variables; terminology in comment
Karl Williamson [Sat, 12 Feb 2022 21:29:14 +0000 (14:29 -0700)]
toke.c: Rename some variables; terminology in comment

Previously in places, things were called variously delimiter and
terminator, or variants thereof.  This makes things consistent, and
clearer.

2 years agotoke.c: Split a variable into two for clarity
Karl Williamson [Sat, 12 Feb 2022 19:48:12 +0000 (12:48 -0700)]
toke.c: Split a variable into two for clarity

It can have two different meanings; split and rename to clarify what
meaning it refers to.

2 years agotoke.c: Rmv unnecessary SV
Karl Williamson [Sun, 20 Feb 2022 17:26:24 +0000 (10:26 -0700)]
toke.c: Rmv unnecessary SV

This code created an SV simply to get SVfARG() to print it out.  But
nowadays there is UTF8fARG which does the right thing on strings, so the
SV is unnecessary.

The code also has a fix where non-ASCII but Latin1 delimiters  when 'use
utf8' is in effect would potentially come out as garbage  This commit
also adds a clause in a conditional to prevent that.

2 years agoAdd builtin::trim()
Karl Williamson [Thu, 17 Feb 2022 02:28:53 +0000 (19:28 -0700)]
Add builtin::trim()

Most of this code came from Paul Evans and Scott Chief Baker

2 years agoAdd is_XPERLSPACE_utf8_safe_backwards()
Karl Williamson [Thu, 17 Feb 2022 00:40:58 +0000 (17:40 -0700)]
Add is_XPERLSPACE_utf8_safe_backwards()

This macro starts from the right side and matches UTF-8 white space
characters.

2 years agoregen/regcharclass.pl: Add backwards UTF-8 tries
Karl Williamson [Sun, 6 Jun 2021 19:45:05 +0000 (13:45 -0600)]
regen/regcharclass.pl: Add backwards UTF-8 tries

This adds the ability to generate a trie macro that starts at the right
end of a string and backs up one matching byte at a time until a full
character is matched; bailing immediately if a non-matching byte is
found.

Previously, the way to accomplish this was to call the function to hop
back (which looked at the string byte by byte backwards until it found a
non-continuation byte), and then look forwards for matching bytes.

This new way is more efficient, as only the necessary bytes are
examined.

2 years agoMark regex sets feature as accepted
Karl Williamson [Sun, 6 Mar 2022 20:42:48 +0000 (13:42 -0700)]
Mark regex sets feature as accepted

It is no longer experimental.

2 years agoRemove use of experimental regex sets warnings
Karl Williamson [Sun, 6 Mar 2022 20:10:12 +0000 (13:10 -0700)]
Remove use of experimental regex sets warnings

These warnings are no longer generated; so simplify the core by not
trying to turn them off.

The warning is preserved so that other code need not change, but this
commit also turns the default generation of it off.

2 years agoStop emitting the experimental::regex_sets warning
Karl Williamson [Sun, 6 Mar 2022 19:36:07 +0000 (12:36 -0700)]
Stop emitting the experimental::regex_sets warning

This is in preparation for it becoming non-experimental

2 years agoUpdate Devel::PPPort to 3.68
Sawyer X [Sat, 19 Mar 2022 12:57:55 +0000 (13:57 +0100)]
Update Devel::PPPort to 3.68

2 years agoFix Atoomic's entries in AUTHORS and .mailmap
Sawyer X [Fri, 18 Mar 2022 19:12:10 +0000 (20:12 +0100)]
Fix Atoomic's entries in AUTHORS and .mailmap

2 years agoUpdate Scalar-List-Utils from 1.61 to 1.62
Sawyer X [Fri, 18 Mar 2022 18:54:38 +0000 (19:54 +0100)]
Update Scalar-List-Utils from 1.61 to 1.62

2 years agoperldelta entry for the new key behaviour for large hashes 19208/head
Nicholas Clark [Thu, 21 Oct 2021 18:57:50 +0000 (18:57 +0000)]
perldelta entry for the new key behaviour for large hashes

Note that large hashes (that are neither objects nor symbol tables) no
longer used the shared string table, and what the performance implications
might be.

This commit and the related code commits incorporate several improvements
suggested by Hugo during review.

2 years agoHeuristically turn off shared hash keys for larger hashes
Nicholas Clark [Tue, 19 Oct 2021 10:51:29 +0000 (10:51 +0000)]
Heuristically turn off shared hash keys for larger hashes

The assumption is that large hashes (that are not objects or symbol tables)
have keys that are not repeated in other hashes, hence (also) storing those
keys in the shared string table is creating work without real benefit.

2 years agoExplicitly clear the HVhek_NOTSHARED bit on entry to hv_common
Nicholas Clark [Tue, 19 Oct 2021 09:16:03 +0000 (09:16 +0000)]
Explicitly clear the HVhek_NOTSHARED bit on entry to hv_common

Some callers to hv_common() pass the flags value from an existing HEK, and
if that HEK is not shared, then it has the relevant flag bit set, which
must not be passed into share_hek_flags().

There is an assertion that catches this in share_hek_flags() if assertions
are enabled.

Remove the analogous assertion in save_hek_flags() - to comply with this
assertion he_dup() and new_HVhv() would need to be changed to clear the
flag bit before every call, only for share_hek_flags() to add it right back.
This feels like makework.

2 years agoEliminate "masked_flags" from functions in hv.c
Nicholas Clark [Tue, 19 Oct 2021 08:50:29 +0000 (08:50 +0000)]
Eliminate "masked_flags" from functions in hv.c

This was confusing because there are (at least) 3 types of masking needed

*) the bits that we record (HVhek_UTF8 and HVhek_WASUTF8)
*) the bit that flags storage type (HVhek_NOTSHARED)
*) the bit that triggers key freeing (HVhek_FREEKEY)

and at different times we need to mask out different things.

So eliminate the ambiguous term "mask", and instead explicitly test or mask
the bits we need.

2 years agoRename HVhek_UNSHARED to HVhek_NOTSHARED
Nicholas Clark [Mon, 18 Oct 2021 19:56:09 +0000 (19:56 +0000)]
Rename HVhek_UNSHARED to HVhek_NOTSHARED

"HVhek_UNSHARED" marked unshared HEKs - allocated directly with malloc(),
rather then from the shared string table, and released with free().

But *shared* HEKs (in the shared string table) are released by calling
unshare_hek(), whilst unshared HEKs should never go near this.

So rename them to "not shared", to avoid this confusion. Change their flag
bit from 0x08 to 0x04 to remove a gap. 0x04 had previously been used to
flag "REHASH", which was removed before v5.18.0

Move the definition of the macro HVhek_MASK from hv.h to hv.c

2 years agoDrop the unused hv argument from S_hv_free_ent_ret()
Nicholas Clark [Thu, 21 Oct 2021 18:53:01 +0000 (18:53 +0000)]
Drop the unused hv argument from S_hv_free_ent_ret()

In turn, this means that the hv argument to Perl_hv_free_ent() and
Perl_hv_delayfree_ent() is now clearly unused, so mark it as such. Both
functions are deemed to be API, so unlike the static function
S_hv_free_ent_ret we can't simply change their parameters.

However, change all the internal callers to pass NULL instead of the hv, as
this makes it obvious that the function does not read hv, and might cause
the compiler to generate better code.

2 years agoUse each HEK's own flags to decide "shared or not", instead of the HV's
Nicholas Clark [Sun, 17 Oct 2021 18:52:28 +0000 (18:52 +0000)]
Use each HEK's own flags to decide "shared or not", instead of the HV's

Previously it was assumed that a hash with HvSHAREKEYS() true could only
contain shared HEKs, and a hash with it false always contained only unshared
HEKs. As HEKs all contain a flag bit to indicated "shared or not", instead
use that to take decisions on how to dup or free them.

2 years agoPass usequadmath to config_sh.PL
Daniel Laügt [Fri, 18 Mar 2022 16:21:24 +0000 (17:21 +0100)]
Pass usequadmath to config_sh.PL

2 years agoFix inttypes.h reference in perlhacktips
Dagfinn Ilmari Mannsåker [Tue, 15 Mar 2022 18:49:17 +0000 (18:49 +0000)]
Fix inttypes.h reference in perlhacktips

2 years agoalways prevent setting POK flag when NV values are used as strings
Graham Knop [Tue, 15 Mar 2022 14:19:03 +0000 (15:19 +0100)]
always prevent setting POK flag when NV values are used as strings

Since PR #18958, values that start as IVs will not get their POK flags
set when they are used as strings. This is meant to aid in
serialization, allowing the "original" type of a value to be preserved.

For NV values, the POK flag was already usually not being set, because
the string form of a float could change based on the locale changing.
However, for Inf and NaN values, the POK flag would still be enabled.
Also, POK would be set for all floats if USE_LOCALE_NUMERIC was not
defined.

Update Perl_sv_2pv_flags to only enable the POKp flag when storing the
PV for Inf or NaN values, or all NVs when USE_LOCALE_NUMERIC is not
defined.

2 years agoAdd mention of new `builtin::indexed` to perldelta
Paul "LeoNerd" Evans [Wed, 9 Mar 2022 11:43:42 +0000 (11:43 +0000)]
Add mention of new `builtin::indexed` to perldelta

2 years agoNo need to document 'useless use of sort in scalar context' separately now there...
Paul "LeoNerd" Evans [Wed, 9 Mar 2022 11:31:43 +0000 (11:31 +0000)]
No need to document 'useless use of sort in scalar context' separately now there's a general category for it

2 years agoAn initial implementation of builtin::indexed
Paul "LeoNerd" Evans [Mon, 14 Mar 2022 11:13:15 +0000 (11:13 +0000)]
An initial implementation of builtin::indexed

* Implementation, unit tests, documentation

2 years agoAdd missing builtin diagnostic to perldiag.pod; rename 'compiletime' to 'compile...
Paul "LeoNerd" Evans [Wed, 9 Mar 2022 11:05:33 +0000 (11:05 +0000)]
Add missing builtin diagnostic to perldiag.pod; rename 'compiletime' to 'compile time' for consistency

2 years agot/porting/diag.t: Don't skip the bodies of XS functions in builtin.t
Paul "LeoNerd" Evans [Wed, 9 Mar 2022 11:02:12 +0000 (11:02 +0000)]
t/porting/diag.t: Don't skip the bodies of XS functions in builtin.t

2 years agohv.c: remove dead function ptr_hash()
Yves Orton [Sun, 13 Mar 2022 13:35:54 +0000 (14:35 +0100)]
hv.c: remove dead function ptr_hash()

ptr_hash() was made obsolete by c3c9d6b15f57fdce79988a553671a1ceb54c0f10

It is a static function only used or exposed in hv.c and is no longer
used, this deletes it.

No tests required, it is not used.

2 years agoRevert "Fix GH Issue #19472: read warnings from open($fh,">",\(my $x))"
Yves Orton [Sat, 12 Mar 2022 01:45:09 +0000 (02:45 +0100)]
Revert "Fix GH Issue #19472: read warnings from open($fh,">",\(my $x))"

This reverts commit 8b03aeb95ab72abdb2fa40f2d1196ce42f34708d.

This is causing BBC breakage, and its unimport and grey zone enough that
we can pick it up in 5.37 when we have more time to deal with it.

2 years agoperl.c: www.perl.org uses https
Richard Leach [Sun, 13 Mar 2022 18:48:12 +0000 (18:48 +0000)]
perl.c: www.perl.org uses https

2 years agoDelete Porting/check83.pl
Leon Timmermans [Fri, 11 Mar 2022 15:04:52 +0000 (16:04 +0100)]
Delete Porting/check83.pl

We stopped caring about 8.3 compliance at least 15 years ago, and
currently ship hundreds of files that aren't compliant with such a
filesystem. This script doesn't serve any purpose anymore.

2 years agoImport perl5341delta.pod
Steve Hay [Sun, 13 Mar 2022 09:15:09 +0000 (09:15 +0000)]
Import perl5341delta.pod

2 years agoUpdate Module-CoreList with data for 5.34.1
Steve Hay [Sun, 13 Mar 2022 09:00:28 +0000 (09:00 +0000)]
Update Module-CoreList with data for 5.34.1

2 years agoFill in date for 5.34.1
Steve Hay [Sat, 12 Mar 2022 17:35:46 +0000 (17:35 +0000)]
Fill in date for 5.34.1

(cherry picked from commit 1181cf72936404b890ef41362f533fe2c2626f9b)

2 years agoTick off release
Steve Hay [Sun, 13 Mar 2022 08:49:19 +0000 (08:49 +0000)]
Tick off release

2 years agoAdd epigraph for 5.34.1
Steve Hay [Sun, 13 Mar 2022 08:49:07 +0000 (08:49 +0000)]
Add epigraph for 5.34.1

2 years agoFix order of builtin:: warnings tests
Paul "LeoNerd" Evans [Fri, 11 Mar 2022 12:57:51 +0000 (12:57 +0000)]
Fix order of builtin:: warnings tests

2 years agoFix error in util.c causing clang++ build-time failure
James E Keenan [Thu, 10 Mar 2022 19:38:42 +0000 (19:38 +0000)]
Fix error in util.c causing clang++ build-time failure

As suggested by Leon Timmermans in
https://github.com/Perl/perl5/issues/19515.

Same problem detected in hv.c.

Pull request:  https://github.com/Perl/perl5/pull/19516

2 years agoUpdate Devel-PPPort to match 3.67
Nicolas R [Tue, 8 Mar 2022 20:35:15 +0000 (14:35 -0600)]
Update Devel-PPPort to match 3.67

2 years agoUpdate Devel-PPPort to match last 3.66 release
Nicolas R [Fri, 4 Mar 2022 00:01:23 +0000 (18:01 -0600)]
Update Devel-PPPort to match last 3.66 release

2 years agohv.c - rework PL_hash_rand_bits update logic, add tests, -Dh debug mode
Yves Orton [Sun, 6 Mar 2022 08:42:14 +0000 (09:42 +0100)]
hv.c - rework PL_hash_rand_bits update logic, add tests, -Dh debug mode

This moves all run time mutations of PL_hash_rand_bits into a set of
macros which allow us to debug what is happening. It also moves away
from our poor mans RNG based on mixing in various sources of data as
we go and switches to using an XORSHIFT RNG for generating the random
bits. This particular RNG is very efficient, using three xor operations
and three shift operations, so it shouldn't hurt us to use it. As a
bonus it also removes the conditional logic involved, as we use seed()
to initialize things at the very beginning when we are running under
RANDOMIZE mode, which should fix any problems with running on platforms
that do not use process space randomization like cygwin.

It adds support for -Dh under DEBUGGING to allow introspection of the
the state of PL_hash_rand_bits and source and cause of changes to it.
With -Dhv you can also get an idea of the keys which are triggering
these mutations as well. -Dh has also been changed to imply
PERL_HASH_SEED_DEBUG as a convenience.

This goes alongside a new test, based on one from Nicholas R (atoomic)
to test that the various PERL_PERTURB_KEYS options behave as expected
and that 1 bit mutations of the seed actually *do* affect the key order
and hashing of our strings. The test is run many times to ensure that
it passes under many different randomly generated hash seeds. Parts of
this test would fail without the preceding commit to this one adjusting
how SBOX32 is initialized.

2 years agohv_func.h - switch sbox32 initializer to use the 128 bit seeding logic
Yves Orton [Sun, 6 Mar 2022 08:38:48 +0000 (09:38 +0100)]
hv_func.h - switch sbox32 initializer to use the 128 bit seeding logic

The 96 bit seed initializer was not mixing the seed bits very well and a
a 1 bit change to the seed used for the sbox initialization was not
propagating throughout the full SBOX buffer. The 128 bit variant is more
robust, and this patch makes it even more so by churning it longer, and
mixing in the seed twice.

This change also removes the old 96 bit variant and code that uses it
as I don't think it should be used anymore at all.

2 years agotest.pl - rework runperl_and_capture() to be a bit easier to use
Yves Orton [Mon, 7 Mar 2022 10:19:51 +0000 (11:19 +0100)]
test.pl - rework runperl_and_capture() to be a bit easier to use

Parts of runperl_and_capture() were a bit odd, also it lacked
debugging features that are helpful, so rework it a bit and add the
debugging options.

2 years agotest.pl - move runperl_and_capture() out of runenv.t
Yves Orton [Mon, 7 Mar 2022 10:18:20 +0000 (11:18 +0100)]
test.pl - move runperl_and_capture() out of runenv.t

We will reuse this, and so might others, so might as well add it to
test.pl

2 years agotest.pl - add unlink_tempfiles()
Yves Orton [Mon, 7 Mar 2022 10:11:36 +0000 (11:11 +0100)]
test.pl - add unlink_tempfiles()

2 years agotest.pl - allow more than 676 tempfiles() in one process
Yves Orton [Sun, 6 Mar 2022 08:25:51 +0000 (09:25 +0100)]
test.pl - allow more than 676 tempfiles() in one process

This reworks testfile() to allow more than 26**2 (676) calls to
tempfile() in the course of a single test process.

In order to keep the filenames short (which I believe is an objective of
this code) I switched the presentation of the pid to using base 26 as
well. Also added comments and a nicer error message if you reach the new
max of 26**3 (17576)

2 years agoINSTALL - fix broken pod in PERL_PERTURB_KEYS docs
Yves Orton [Mon, 7 Mar 2022 11:27:49 +0000 (12:27 +0100)]
INSTALL - fix broken pod in PERL_PERTURB_KEYS docs

2 years agoperlvar.pod - add more info about demarcated variable form
Yves Orton [Sun, 6 Mar 2022 11:34:33 +0000 (12:34 +0100)]
perlvar.pod - add more info about demarcated variable form

2 years agopod/perlre.pod - document @{^CAPTURE} magic variable
Yves Orton [Sun, 6 Mar 2022 11:32:47 +0000 (12:32 +0100)]
pod/perlre.pod - document @{^CAPTURE} magic variable

This variable is documented in perlvar but we really should also mention
it in perlre since its reason for existence is to provide array access
to the capture variables in a pattern.

2 years agopod/perldata.pod - document demarcated var form (curly braces) better
Yves Orton [Sun, 6 Mar 2022 11:08:51 +0000 (12:08 +0100)]
pod/perldata.pod - document demarcated var form (curly braces) better

Perl supports using curly braces for demarcated variable notation, both
in normal code but especially for interpolation. Some variables, such
as a multi-character caret variables must use this form at all times,
and must use this form to achieve interpolation of a variable subscript.

Prior to this patch we only documented the simple forms of this feature,
for example "${who}'s this then", but we did not document that it also
includes more complex variable access like array subscripts
"@{array[1,5]}" nor the cases where this form is outright required such
as when interpolating multi char caret variables like "${^CAPTURE[10]}".

This patch provides explanation for the full range of cases and also
documents how backslash can used as another form of disambiguation.

See GH Issue #19497 and GH Issue #18800 for examples of people being
confused by this notation.

2 years agoimproved .mailmap and AUTHORS file logic
Yves Orton [Tue, 1 Mar 2022 05:52:06 +0000 (06:52 +0100)]
improved .mailmap and AUTHORS file logic

This change updates AUTHORS with multiple missing contributors to the
project. It updates .mailmap so that the preferred email for each
developer matches what is in AUTHORS (sometimes changing the AUTHORS
entry, sometimes changes the .mailmap entry or entries to achieve this
goal. It also adds a new tool, Porting/UpdateAuthors.pl which can be
used to automatically update the relevant data.

The general idea is that if you run Porting/UpdateAuthors.pl any never
developers will be added to AUTHORS, and new entries will be added to
the .mailmap file. The aim is that the only data we need to have to
manage both files is the data in both files and the commit history
itself. There is NOT embedded special datasets in the tool.

The idea is that *every* developer, be it author or committer has at
least one entry in .mailmap, and that the vast majority of the email
data we have for commits is mapped to corresponding entry in the AUTHORS
file. Furthermore the .mailmap file is expected to have an entry for
every distinct email ever used by a developer on the project.

If you run Porting/UpdateAuthors.pl the tool will analyze all the
commits in the projects history, and update either or both the .mailmap
and AUTHORS file appropriately. If an existing developer adds a commit
which either has the same name or email as is listed already then it
will DTRT and update the .mailmap with the appropriate mappings. If a
new developer adds a commit then it will DTRT and update both the
.mailmap and the AUTHORS file with that developers details.

Every single existing distinct name/email combination has been added to
the mailmap, and matched to AUTHORS data. In some case where there was
conflicting or missing data I used an educated guess, contacted the
developer myself, or verified the email with the email provider. Eg.
gmail.com will helpfully resolve gmail email addresses to their name if
you simply type the email address into a new mail.

testing

testing

fixup

fixup

fixup

2 years agocheckAUTHORS.pl - allow the script to be used as a module.
Yves Orton [Wed, 2 Mar 2022 02:30:35 +0000 (03:30 +0100)]
checkAUTHORS.pl - allow the script to be used as a module.

With this change it is possible to:

    require "Porting/checkAUTHORS.pl";

and access the functions it contains.

2 years agoAdd tests for increased NV precision in Devel::Peek::Dump
TAKAI Kousuke [Tue, 8 Mar 2022 10:17:35 +0000 (19:17 +0900)]
Add tests for increased NV precision in Devel::Peek::Dump