This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
2 years agoMake sure to rpeep() the body of catch {} blocks
Paul "LeoNerd" Evans [Thu, 20 Jan 2022 14:28:04 +0000 (14:28 +0000)]
Make sure to rpeep() the body of catch {} blocks

2 years agoProvide inclusive names allowlist and denylist
Mike Fulton [Sat, 15 Jan 2022 00:23:47 +0000 (16:23 -0800)]
Provide inclusive names allowlist and denylist

Updated the following files:
 AUTHORS:
  - corrected my email address
 MANIFEST:
  - added new testcases for Locale-Maketext
 dist/Locale-Maketext/ChangeLog:
  - short summary of changes made
 dist/Locale-Maketext/lib/Locale/Maketext.pm:
  - updated the version to 1.30
  - refactored the code to create a common method _include
    called by the allowlist and whitelist methods
    (whitelist is now an alias, deprecated method, for allowlist).
    The _include method now has an internal list called allowlist
    that is updated by calls to _include through whitelist or
    allowlist methods.
  - refactored the code to create a common method _exclude
    called by the denylist and blacklist methods
    (blacklist is now an alias, deprecated method, for denylist).
    The _exclude method now has an internal list called denylist
    that is updated by calls to _exclude through blacklist or
    denylist methods.
 dist/Locale-Maketext/lib/Locale/Maketext.pod:
  - documented allowlist and denylist as new methods
  - added a NOTE for allowlist and denylist indicating that
    they are now the preferred method names to use instead
    of whitelist and blacklist
 dist/Locale-Maketext/t/92_blacklist.t
  - updated the code to have messages in terms of allowlist
    and denylist. Actual code continues to test blacklist
    method.
 dist/Locale-Maketext/t/93_whitelist.t
  - updated the code to have messages in terms of allowlist
    and denylist. Actual code continues to test whitelist
    method.

Created 2 new testcases:

 dist/Locale-Maketext/t/94_denylist.t
  - this testcase is analagous to 92_blacklist.t but calls
    the denylist method instead of the blacklist method.

 dist/Locale-Maketext/t/95_allowlist.t
  - this testcase is analagous to 93_whitelist.t but calls
    the allowlist method instead of the whitelist method.

2 years agoperldelta for empty sort croak (78cc98885ff2800c)
David Mitchell [Wed, 19 Jan 2022 20:46:43 +0000 (20:46 +0000)]
perldelta for empty sort croak (78cc98885ff2800c)

2 years agot/porting/authors.t: Windows fixes
Tomasz Konojacki [Wed, 19 Jan 2022 18:47:39 +0000 (19:47 +0100)]
t/porting/authors.t: Windows fixes

^ is a shell metacharacter in cmd.exe, so it needs to be quoted.

Also, /dev/null doesn't exist on Windows.

2 years agomake a sort with zero args a compile-time err
David Mitchell [Wed, 19 Jan 2022 20:05:28 +0000 (20:05 +0000)]
make a sort with zero args a compile-time err

    @a = sort @empty; # unaffected
    @a = sort;        # now a compile-time error

the main motivation for this is to potentially be able to treat a
colon following the 'sort' keyword as part of the sort expression,
to then be able to add sort attributes at some point, e.g.
    @a = sort :num, 1,2,3;
rather than the colon being seen as part of a ?: conditional.

See http://nntp.perl.org/group/perl.perl5.porters/262425.

2 years agoStop setting console to "con" on non-MSWin systems
E. Choroba [Tue, 18 Jan 2022 17:20:34 +0000 (18:20 +0100)]
Stop setting console to "con" on non-MSWin systems

The condition has existed since eternity but it never made sense.
Only use "con" if $^O eq 'MSWin32'.

Also, remove MSDOS from the comment: it's the last forgotten mention
of the OS in the whole file.

2 years agofix commit calculations in authors porting test
Graham Knop [Wed, 19 Jan 2022 02:07:03 +0000 (03:07 +0100)]
fix commit calculations in authors porting test

For pull requests, the current commit is a merge commit simulated by
github. The first parent will be from blead - anything that has been
commited since the creation of the branch. The second parent will be the
last commit on the branch, which is what we want to test.

The commit range should be all of the commits in the second parent,
excluseding the first parent. We can use HEAD^1 and HEAD^2 for these.
The merge-base does not need to be precomputed, since the .. in the
commit range does that for us.

2 years agoUpdate Win32 to CPAN version 0.58
Chris 'BinGOs' Williams [Wed, 19 Jan 2022 14:00:58 +0000 (14:00 +0000)]
Update Win32 to CPAN version 0.58

  [DELTA]

0.58    [2022-01-17]
        - add Win32::HttpGetFile (thanks to Craig Berry for the implementation
          and Tomasz Konojacki for code review) [PR/30]
        - skip failing Unicode.t on Cygwin because cwd() no longer returns an
          ANSI (short) path there.
        - Fixed test 14,15 of GetFullPathName.t when package is unpacked in a
          top level folder (thanks to Jianhong Feng) [PR/20]

2 years agoUpdate NEXT to CPAN version 0.69
Chris 'BinGOs' Williams [Wed, 19 Jan 2022 13:58:16 +0000 (13:58 +0000)]
Update NEXT to CPAN version 0.69

  [DELTA]

0.69 2022-01-19 NEILB
    - Removed dependency on mro. PR#5 from HAARG++.
    - Only install in perl dirs on older perls with bad load order
      PR#6 from HAARG++.

2 years agoUpdate File-Fetch to CPAN version 1.04
Chris 'BinGOs' Williams [Tue, 18 Jan 2022 23:13:06 +0000 (23:13 +0000)]
Update File-Fetch to CPAN version 1.04

  [DELTA]

1.04        Tue Jan 18 20:46:04 2022

* Resolve test warnings reported in GitHub issue #22
  relating to Github's deprecation and removal of git:// protocol

* Pointed various RFC links in docs to ietf.org

2 years agoz/OS ASCII Enablement: Manage untagged header errno.h by copy & tag
Mike Fulton [Fri, 31 Dec 2021 19:25:41 +0000 (11:25 -0800)]
z/OS ASCII Enablement: Manage untagged header errno.h by copy & tag

   The system headers on z/OS are in EBCDIC, but are untagged. The bi-modal build requires that files be tagged correctly
   so this patch copies the errno.h file (which may be mounted on a read-only file system) to a local file and then tags
   it as IBM-1047 (EBCDIC) so that it can be processed properly. The longer-term fix for this may be to have z/OS tag
   header files as EBCDIC, although this would not be something Perl could rely on for several years.

2 years agoofficially support Visual C++ 2022
Tomasz Konojacki [Sun, 16 Jan 2022 18:35:44 +0000 (19:35 +0100)]
officially support Visual C++ 2022

No code changes are needed.

2 years agoPERL_SET_CONTEXT(t) needs to set PL_current_context from C++ too
Nicholas Clark [Sat, 8 Jan 2022 21:08:19 +0000 (21:08 +0000)]
PERL_SET_CONTEXT(t) needs to set PL_current_context from C++ too

We want to use C11 thread local storage where possible, as its read overhead
is lower. However C++ uses incompatible syntax for TLS, so we have to hide
the variable from C++ extensions, and have the read code "fall back" to the
pthread_getspecific() approach.

However, C++ extensions also need to be able to call PERL_SET_CONTEXT(t) and
have everything still work the same as C extensions. Hence they *also* need
to set PL_current_context - a variable that has to be hidden from them.
Hence change the version of the PERL_SET_CONTEXT macro used by C++
extensions from inline code to a call to Perl_set_context(), and have that
set PL_current_context (when used).

Technically this commit also fixes a bug in that Perl_set_context() is API
and should have been setting PL_current_context since that variable was
first introduced. In practice, likely nothing uses this API, as there is no
code on CPAN that calls it, and the macro PERL_SET_CONTEXT() is much more
prominent.

2 years agoFor C++ extensions, use the pthreads definition of PERL_GET_CONTEXT
Nicholas Clark [Tue, 4 Jan 2022 18:27:17 +0000 (18:27 +0000)]
For C++ extensions, use the pthreads definition of PERL_GET_CONTEXT

Configure probes the C compiler to find out whether it supports C11 thread
local storage, and if found uses this for PERL_SET_CONTEXT/PERL_GET_CONTEXT,
in preference to the pthread_setspecific()/pthread_getspecific() approach.

However, we can come unstuck with XS extensions written in C++, as C++ and C
disagree on the syntax used for thread local storage, meaning that the
working token that Configure probed for C turns out to be a compiler error
on C++.

As Configure doesn't have a way to probe for C++ dialects, we just take the
safe option and do the same as 5.34.0 and earlier - use pthreads on C++.

This commit is minimal because the implementation of PERL_SET_CONTEXT for
C11 thread local storage was already defensively written to *also* call
pthread_setspecific().

2 years agoUpdate File-Fetch to CPAN version 1.02
Chris 'BinGOs' Williams [Tue, 11 Jan 2022 12:21:27 +0000 (12:21 +0000)]
Update File-Fetch to CPAN version 1.02

  [DELTA]

1.02        Fri Jan  7 14:44:34 2022

* wget: use --passive-ftp switch only for ftp scheme

2 years agoEUPXS was updated on CPAN
Chris 'BinGOs' Williams [Tue, 11 Jan 2022 12:20:11 +0000 (12:20 +0000)]
EUPXS was updated on CPAN

2 years agoMake spelling of values for 'FILES' consistent 19336/head
James E Keenan [Sat, 8 Jan 2022 19:40:20 +0000 (19:40 +0000)]
Make spelling of values for 'FILES' consistent

While developing a program which require-s Porting/Maintainers.pl for
the data in %Modules, I noticed that the entries for two modules'
'FILES' key-value pairs were spelled with a trailing slash.  All other
'FILES' KVPs omitted the trailing slash.

For consistency, let's omit the trailing slash.  Once that's done, two
invocations of "./perl -Ilib Porting/makemeta -y" were needed to make
'make test_porting' happy.

2 years agoAdded releasers for next 3 dev releases
Neil Bowers [Sun, 9 Jan 2022 22:00:38 +0000 (22:00 +0000)]
Added releasers for next 3 dev releases

2 years agoAdd date of release of ExtUtils-ParseXS 3.44
Sawyer X [Thu, 6 Jan 2022 23:03:04 +0000 (00:03 +0100)]
Add date of release of ExtUtils-ParseXS 3.44

2 years agoUpdate the README to describe ASCII and EBCDIC builds
Mike Fulton [Fri, 31 Dec 2021 21:44:02 +0000 (13:44 -0800)]
Update the README to describe ASCII and EBCDIC builds

 Rewrite of the readme file to bring it up to date and to document the
 various ways Perl can now be built and used on z/OS.

2 years agoAdd missing aliases for \p{Present_In}
Karl Williamson [Wed, 5 Jan 2022 16:00:53 +0000 (09:00 -0700)]
Add missing aliases for \p{Present_In}

\p{Present_In} is a Perl extension of the Unicode Age property, added
because knowing the exact Unicode version in which a code point became
assigned is rarely what you want; much more frequently you want to know
if the code point exists in the version or not.  (Since this extension
was added, Unicode changed their language to declare that the Age
property should be interpreted in pattern matching, not as described,
but as Perl's Present_In is.  But  I chose to not change Age, to avoid
backwards compatibility issues, and this way, a coder can choose which
thing s/he wanted.)

Unicode typically has synonyms (aliases) for each value a property can
tak on, so \p{Age=6.1} and \p{Age=V61_1} mean the same thing.

Prior to this commit, neither \p{Present_In=1_1} nor \p{Present_In=NA}
worked.

2 years agomktables: Add variable for clarity
Karl Williamson [Wed, 5 Jan 2022 15:51:38 +0000 (08:51 -0700)]
mktables: Add variable for clarity

This uses a new variable whose name reflects its usage, making the code
easier to understand.

2 years agoPod::Html: improve all tests
Michiel Beijen [Thu, 30 Dec 2021 11:54:11 +0000 (12:54 +0100)]
Pod::Html: improve all tests

"use warnings;" in all tests.  Remove emacs identifiers.  Change tabs to
spaces in tests.

For: https://github.com/Perl/perl5/pull/19304

2 years agoUpdate Changes log for ExtUtils::ParseXS:
Sawyer X [Tue, 4 Jan 2022 15:30:17 +0000 (16:30 +0100)]
Update Changes log for ExtUtils::ParseXS:

I've walked the history and grabbed changes to the code itself, not the
perlxs et. al. pod files.

2 years agoHash::Util::FieldHash: improve test suite
Michiel Beijen [Sun, 26 Dec 2021 10:31:39 +0000 (11:31 +0100)]
Hash::Util::FieldHash: improve test suite

 - do not count tests:
    - use done_testing
    - put tests requiring threading in their own subtests so we can
      skip_all
 - smaller improvements: use strict & warnings everywhere, tabs >>
   spaces

2 years agodist/Time-HiRes/t/stat.t: Provide descriptions for all tests 19322/head
James E Keenan [Tue, 4 Jan 2022 00:18:13 +0000 (00:18 +0000)]
dist/Time-HiRes/t/stat.t: Provide descriptions for all tests

Convert 'print' to 'Test::More::note' in stat.t and t/Watchdog.pm.
Require Test More 0.84 to get 'note' function per feedback from Tony
Cook in https://github.com/Perl/perl5/pull/19322.

2 years agodoio.c: White-space, comment only
Karl Williamson [Sun, 2 Jan 2022 01:45:35 +0000 (18:45 -0700)]
doio.c: White-space, comment only

2 years agoAdd missing fcn return declaration
Karl Williamson [Sun, 2 Jan 2022 01:43:42 +0000 (18:43 -0700)]
Add missing fcn return declaration

This was introduced by 1c267c880abb4d52f0dc23c70636b5f2e80253be.

2 years agoNeed to remove ASCII tags on copied compiled executables for z/OS ASCII
Mike Fulton [Fri, 31 Dec 2021 21:55:37 +0000 (13:55 -0800)]
Need to remove ASCII tags on copied compiled executables for z/OS ASCII

 Untag compiled executables (perl and the .so files) after they are
 copied with File::copy because File::copy is marking them as CCSID 819
 (ASCII). The longer term fix for this could be to provide a syscopy on
 z/OS which would perform a _cp_ which on z/OS copies the tag
 information as part of the copy.

2 years agoz/OS ASCII needs file descriptors on pipes tagged as ASCII
Mike Fulton [Fri, 31 Dec 2021 22:00:56 +0000 (14:00 -0800)]
z/OS ASCII needs file descriptors on pipes tagged as ASCII

 Add code to change the file descriptor on the file descriptors opened from
 ``Perl_my_popen_list`` and ``Perl_my_popen`` so that the CCSID of the file
 descriptor is 819. This change is only when the code is built for
 ASCII ``#if (__CHARSET_LIB == 1)`` on z/OS ``#if defined(OEMVS)``.

2 years agoEnable z/OS to run with '-e' option for runtests
Mike Fulton [Fri, 31 Dec 2021 22:08:31 +0000 (14:08 -0800)]
Enable z/OS to run with '-e' option for runtests

 Change this code so that the unset of MAKEFLAGS is protected because,
 on z/OS, unset will return non-zero if the variable is not set and this
 then causes the shell to fail because it is being run with _-e_. This
 change is only required for z/OS but is harmless to have on all
 platforms.

2 years agoProvide asciiopen and asciiopen3 for z/OS ASCII I/O
Mike Fulton [Fri, 31 Dec 2021 21:50:32 +0000 (13:50 -0800)]
Provide asciiopen and asciiopen3 for z/OS ASCII I/O

 - Provide an _asciiopen_ and _asciiopen3_ pair of functions for opening
   files on z/OS. These services do a standard open and then, if the
   open is successful, update the CCSID of the file descriptor to 819
   (ASCII) iff the oflag has ``O_CREAT`` set (e.g. a file is being
   created).  We could consider printing out a warning if a file is
   untagged - right now this will _work correctly_ if the file in
   encoded as ASCII (CCSID 819) but will fail if the file is EBCDIC.

 - Provide a wrapper _Perl_mkstemp_cloexec_ which not only creates a
   temporary file using mkstemp but will also tag the file as CCSID 819.
   The tagging is only performed if ``__CHARSET_LIB == 1``, i.e. the
   code is compiled with -qascii.

 - Define _PerlIO_open_ and _PerlLIO_open3_ as _asciiopen_ and
   _asciiopen3_ respectively, when the code is built for ASCII ``#if
   (__CHARSET_LIB == 1)`` on z/OS ``#if defined(OEMVS)``.

2 years agonostdio should test for z/OS (i.e. OEMVS) not EBCDIC
Mike Fulton [Fri, 31 Dec 2021 22:04:36 +0000 (14:04 -0800)]
nostdio should test for z/OS (i.e. OEMVS) not EBCDIC

2 years agoSpecify PERL_USE_SAFE_PUTENV when configuring ASCII z/OS builds
Mike Fulton [Fri, 31 Dec 2021 21:15:43 +0000 (13:15 -0800)]
Specify PERL_USE_SAFE_PUTENV when configuring ASCII z/OS builds

The Perl code expects that the ``environ`` global variable can be
re-allocated to new storage and then have entries added and removed from
it. This isn't supported by z/OS when in Bi-Modal mode and so
_PERL_USE_SAFE_PUTENV_ macro is defined to use the _env_ services to
manipulate ``environ`` instead of doing so directly. It is not clear if
it is valid to re-allocate storage for the ``environ`` global variable
or not, although it is worth pursuing with the z/OS development team as
a longer-term potential fix.

2 years agoFix problem in makefile for z/OS 64-bit builds
Mike Fulton [Fri, 31 Dec 2021 23:24:34 +0000 (15:24 -0800)]
Fix problem in makefile for z/OS 64-bit builds

  This change fixes a bug where the value of _use64bitall_ was
  expected to be nothing or something, but in fact, the proper
  test is for ``define|true|[yY]*``.

2 years agoAdd AUTHORS entry for Mike Fulton
Karl Williamson [Sat, 1 Jan 2022 18:47:12 +0000 (11:47 -0700)]
Add AUTHORS entry for Mike Fulton

And make this entry the more public email address, moving the existing
more private one to checkAUTHORS

2 years agoFix builtin typo in descrip_mms.template
Craig A. Berry [Fri, 31 Dec 2021 19:48:34 +0000 (13:48 -0600)]
Fix builtin typo in descrip_mms.template

The one-letter macro for the file extension of an object file is
an oh not a zero.

2 years agoTie::SubstrHash: rewrite tests to use Test::More
Michiel Beijen [Sun, 19 Dec 2021 09:23:02 +0000 (10:23 +0100)]
Tie::SubstrHash: rewrite tests to use Test::More

These tests were still handrolling TAP output. I've dragged the tests
into this century by porting them to Test::More.

For: https://github.com/Perl/perl5/pull/19288

2 years agoReplace bareword filehandle with a lexical scalar:
Sawyer X [Tue, 28 Dec 2021 12:57:48 +0000 (13:57 +0100)]
Replace bareword filehandle with a lexical scalar:

Bareword filehandles are bad and this module should really remove
this one.

I'm also bumping the version to a stable one because why not.

For: https://github.com/Perl/perl5/pull/19302

2 years agoChange pack U behavior for EBCDIC
Karl Williamson [Thu, 16 Dec 2021 21:30:36 +0000 (14:30 -0700)]
Change pack U behavior for EBCDIC

This effectively reverts 3ece276e6c0.

It turns out this was a bad idea to make U mean the non-native official
Unicode code points.  It may seem to make sense to do so, but broke
multiple CPAN modules which were using U the previous way.

This commit has no effect on ASCII-platform functioning.

2 years agocharnames.pm: Avoid pack U
Karl Williamson [Sat, 10 Jul 2021 22:37:37 +0000 (16:37 -0600)]
charnames.pm: Avoid pack U

This is because the behavior of pack U is changing in the next commit,
and this is cleaner anyway.  The conversion functions are optimized out
on ASCII platforms.

2 years agoMerge branch 'patch-1' into blead
James E Keenan [Sun, 26 Dec 2021 20:34:33 +0000 (20:34 +0000)]
Merge branch 'patch-1' into blead

2 years agoExtUtils-ParseXS fix plan/skip in 002-more.t 19300/head
François Perrad [Sun, 26 Dec 2021 19:28:14 +0000 (20:28 +0100)]
ExtUtils-ParseXS fix plan/skip in 002-more.t

The commit https://github.com/Perl/perl5/commit/2647863031762b1897841364c638c3727bc043f1 has added 2 tests in 002-more.t, the plan was updated from 30 to 32.
But the corresponding skip counter was missing.

2 years agoFix misspellings in documentation. Correct spelling of name to 'De
Ivan Panchenko [Sat, 25 Dec 2021 23:14:58 +0000 (00:14 +0100)]
Fix misspellings in documentation. Correct spelling of name to 'De
Morgan'.

Committer: Ivan Panchenko is now a Perl author

For: https://github.com/Perl/perl5/pull/19298

2 years agoDocument and test command-line switch '-?'
James E Keenan [Fri, 12 Nov 2021 23:55:04 +0000 (23:55 +0000)]
Document and test command-line switch '-?'

2 years agoReplace 'slave' with 'client'
James E Keenan [Thu, 3 Jun 2021 12:22:16 +0000 (12:22 +0000)]
Replace 'slave' with 'client'

This commit moves us a step forward on eliminating 'master/slave' terminology.

Its scope is limited to those files within the Perl 5 core distribution which
are not CPAN-upstream.  Within that scope, we leave untouched the use of the
term 'slave' in epigraphs and other literary quotations and its use in data
coming from outside sources (e.g., Unicode code points).

Increment $VERSION in lib/perl5db.pl.  Revisions per rjbs feedback.

For: https://github.com/Perl/perl5/pull/19227

2 years agosv_upgrade: c99 compound literals to initialize xpvav/xpvhv
Richard Leach [Thu, 9 Dec 2021 22:38:51 +0000 (22:38 +0000)]
sv_upgrade: c99 compound literals to initialize xpvav/xpvhv

For both the AV and HV cases, the new body is Zero()ed but then various
struct members are set to non-zero values. Now that we support parts of
c99, it seems more efficient to use compound literals to initailize the
struct members.

With gcc v8.3.0, the compiled function is smaller by 25 instructions.
sv.o is slightly smaller, but the final perl binary size is unchanged.

2 years agosv_upgrade: remove redundant AvALLOC(sv) = 0
Richard Leach [Thu, 9 Dec 2021 22:25:38 +0000 (22:25 +0000)]
sv_upgrade: remove redundant AvALLOC(sv) = 0

xav_alloc is a member of the xpvav struct. The instance modified
here would have been Zero()ed several lines previously, so both
sides of this if() branch should be no-ops.

With gcc 8.3.0 the compiled function is about 6 instructions smaller.

2 years agouse is_deeply instead of eq_ Test::More functions
Michiel Beijen [Sat, 18 Dec 2021 11:10:15 +0000 (12:10 +0100)]
use is_deeply instead of eq_ Test::More functions

the eq_set, eq_hash, and eq_array functions in Test::More are
discouraged to use, and is_deeply is recommended. Ref:

https://metacpan.org/pod/Test::More#Discouraged-comparison-functions

The reason for this is that, if the tests fail, is_deeply has much
better diagnostics.

The other thing is that is_deeply is a test function directly, where
eq_hash and such need to be wrapped inside ok(). This is easy to forget
-- proof of this is in Benchmark.t, where we had this code, that did not
test anything:

    eq_set([keys %$got], [qw(Foo Bar Baz)], 'should be exactly three objects');

It is now replaced by:

    is_deeply([sort keys %$got], [sort qw(Foo Bar Baz)], 'should be exactly three objects');

this commit replaces all usage of eq_set, eq_hash, and eq_array in lib/
and ext/ for tests that use Test::More.

One small exception is where a negated test is used; Test::More does not
have is_not_deeply() or such. Test2 has `isnt()` for this, but that is
not in core. In those cases, we still keep using the eq_ operators.

2 years agoAdd last-resort implementation for POSIX::FLT_ROUNDS.
TAKAI Kousuke [Tue, 14 Dec 2021 09:33:55 +0000 (18:33 +0900)]
Add last-resort implementation for POSIX::FLT_ROUNDS.

POSIX::FLT_ROUNDS now emulates (more) standard behavior that
reflects the current rounding mode set by fesetround(),
even when compiled with GCC whose FLT_ROUNDS is wrongly fixed to 1.

Also add tests for this.

2 years agoPOSIX: FLT_ROUNDS is now an XS function rather than a constant
TAKAI Kousuke [Wed, 20 Jan 2021 11:58:22 +0000 (20:58 +0900)]
POSIX: FLT_ROUNDS is now an XS function rather than a constant

POSIX::FLT_ROUNDS used to be an NV constant, but C FLT_ROUNDS is
actually an integer and not a constant (C99 seems to say that
it reflects the current rounding mode set by fesetround()).

2 years agoBump version number of ext/POSIX
Karl Williamson [Fri, 24 Dec 2021 15:20:22 +0000 (08:20 -0700)]
Bump version number of ext/POSIX

2 years agoAdd option '-?' as a synonym to -h
Karl Williamson [Thu, 30 Sep 2021 15:56:55 +0000 (09:56 -0600)]
Add option '-?' as a synonym to -h

-? is a common paradigm for finding the usage of a program.  Prior to
this commit, doing so on perl would tell you it is illegal and suggest
-h.  This commit allows someone using this paradigm  to skip the second
step

2 years agoData-Dumper: Fixes for EBCDIC
Karl Williamson [Sat, 3 Jul 2021 23:49:12 +0000 (17:49 -0600)]
Data-Dumper: Fixes for EBCDIC

This changes to properly calculate the control characters on EBCDIC
systems.  There should be no change to ASCII doe.

Comments are updated and corrected to properly describe the EBCDIC
situation.

The tests change to use the character \xB6, as that means the same in
both character sets, and so works on both without special casing.

2 years agoBumped Module-CoreList ready for 5.35.8
Neil Bowers [Tue, 21 Dec 2021 01:41:24 +0000 (01:41 +0000)]
Bumped Module-CoreList ready for 5.35.8

2 years agoBump the perl version in various places for 5.35.8
Neil Bowers [Tue, 21 Dec 2021 01:17:04 +0000 (01:17 +0000)]
Bump the perl version in various places for 5.35.8

2 years agonew perldelta for 5.35.8
Neil Bowers [Tue, 21 Dec 2021 00:44:56 +0000 (00:44 +0000)]
new perldelta for 5.35.8

2 years agorecorded 5.35.7 release as done in the release schedule
Neil Bowers [Tue, 21 Dec 2021 00:27:15 +0000 (00:27 +0000)]
recorded 5.35.7 release as done in the release schedule

2 years agoRecorded epigraph for 5.35.7
Neil Bowers [Tue, 21 Dec 2021 00:25:55 +0000 (00:25 +0000)]
Recorded epigraph for 5.35.7

2 years agoMerge branch 'release-5.35.7' into blead
Neil Bowers [Tue, 21 Dec 2021 00:20:05 +0000 (00:20 +0000)]
Merge branch 'release-5.35.7' into blead

2 years agoAdded 5.35.7 to perlhist v5.35.7
Neil Bowers [Mon, 20 Dec 2021 21:46:33 +0000 (21:46 +0000)]
Added 5.35.7 to perlhist

2 years agoUpdated perldelta with changes to core modules
Neil Bowers [Mon, 20 Dec 2021 21:42:04 +0000 (21:42 +0000)]
Updated perldelta with changes to core modules

2 years agoUpdate Module::CoreList for 5.35.7
Neil Bowers [Mon, 20 Dec 2021 21:06:21 +0000 (21:06 +0000)]
Update Module::CoreList for 5.35.7

2 years agoadded some entries to perldelta after trawling the git log
Neil Bowers [Mon, 20 Dec 2021 19:03:35 +0000 (19:03 +0000)]
added some entries to perldelta after trawling the git log

2 years agoUpdated dual-life modules for 5.35.7
Neil Bowers [Mon, 20 Dec 2021 17:03:10 +0000 (17:03 +0000)]
Updated dual-life modules for 5.35.7

2 years agoperldelta entry for the fix for unbounded memory consumption for hashes
Nicholas Clark [Mon, 20 Dec 2021 16:19:54 +0000 (16:19 +0000)]
perldelta entry for the fix for unbounded memory consumption for hashes

This is a fix for a bug introduced two months ago in v5.35.5.

2 years agoMention builtin in perldelta
Paul "LeoNerd" Evans [Sat, 18 Dec 2021 22:52:06 +0000 (22:52 +0000)]
Mention builtin in perldelta

2 years agoDocument that all of builtin is currently experimental
Paul "LeoNerd" Evans [Sat, 18 Dec 2021 21:39:14 +0000 (21:39 +0000)]
Document that all of builtin is currently experimental

2 years agodist/IO/IO.xs: Rmv defns that ppport.h supplies
Karl Williamson [Thu, 17 Jun 2021 03:03:42 +0000 (21:03 -0600)]
dist/IO/IO.xs: Rmv defns that ppport.h supplies

No sense trying to derive them ourselves.

2 years agoNo need to Renew() HvARRAY() to the same size in S_hv_auxinit()
Nicholas Clark [Wed, 10 Nov 2021 10:57:34 +0000 (10:57 +0000)]
No need to Renew() HvARRAY() to the same size in S_hv_auxinit()

Fix a thinko/missed simplification that should have been part of
commit 53a41f9c2c0671d8:
    Inline the xhv_aux struct in the main hash body

    For now, memory for this structure is always allocated, even though it
    isn't always flagged as being present.

Prior to that commit the Renew() in S_hv_auxinit() had been needed because
the memory that HvARRAY() points to needed to be expanded from "just the
array of HE pointers" to "that, plus space for the xhv_aux struct.

With that commit, the xhv_aux struct was no longer stored in the same
memory block, so there was no need to reallocate storage. Hence the
Renew() should be completely removed. What that commit actually did was
neatly change the parameters to the Renew() call such that it reallocated
storage to the exact same size, which isn't wrong, but is makework. Oops.

2 years agoReturn the "hv with aux" PVHV bodies to the correct arena
Nicholas Clark [Tue, 9 Nov 2021 09:24:06 +0000 (09:24 +0000)]
Return the "hv with aux" PVHV bodies to the correct arena

Move the assignments to SvFLAGS(sv) after the check for SvOOK(), and use
arena_index for the array index to PL_body_roots. Without both fixes,
del_body() would always be called with &PL_body_roots[SVt_PVHV], which is
wrong if the body was allocated from &PL_body_roots[HVAUX_ARENA_ROOT_IX].

PVHV body handling was changed recently by commit 94ee6ed79dbca73d:
    Split the XPVHV body into two variants "normal" and "with aux"

    Default to the smaller body, and switch to the larger body if we need to
    allocate a C<struct xpvhv_aux> (eg need an iterator).

    This restores the previous small size optimisation for hashes used as
    objects.

as part of changing where memory for C<struct xpvhv_aux> is allocated.

The new implementation uses two sizes of "bodies" for PVHVs - the default
body is unchanged, but when a hash needs a C<struct xpvhv_aux>, it now
swaps out the default body for a larger body with space for the struct.

(Previously it would reallocate the memory used for HvARRAY() to make space
for the struct there - an approach which requires more tracking of changed
pointers.)

That commit was subtly buggy in that on hash deallocation it didn't *return*
hash bodies to the correct arena. As-was, it would return both sizes of hash
body to the arena for the default (smaller) body. This was due to a
combination of two subtle bugs

1) the explicit reset of all SvFLAGS to SVf_BREAK would implicitly clear
   SVf_OOK. That flag bit set is needed to signal the different body size
2) The code must call del_body() with &PL_body_roots[arena_index], not
   &PL_body_roots[type]
   type is SVt_PVHV for both body sizes. arena_index is SVt_PVHV for the
   smaller (default) bodies, and HVAUX_ARENA_ROOT_IX for the larger bodies.

There were no memory errors or leaks (that would have been detectable by
tools such as ASAN or valgrind), but the bug meant that larger hash bodies
would never get re-used. So for code that was steady-state creating and
destroying hashes with iterators (or similar), instead of those bodies being
recycled via their correct arena, the interpreter would need to continuously
allocate new memory for that arena, whilst accumulating ever more unused
"smaller" bodies in the other arena.

I didn't spot this bug whilst reviewing commit 8461dd8ad90b2bce:
    don't overwrite the faked up type details for hv-with-aux

    CID 340472

which is in the same area of the code, but fixes a related problem.

Curiously when reporting CID 340738:

    Assigning value "SVt_IV" to "arena_index" here, but that stored value is
    overwritten before it can be used

Coverity also didn't spot that the code in question was unconditionally
unreachable, and warn about that, or modify its warning to note that.

(For the code prior to this commit SvOOK(sv) at that point could only ever
be false. This is obscured thanks to macros, but all these macros are
unconditionally defined to the same values, so static analysis should be
able to infer that they are actually constant, and reason accordingly.
To be fair, this is *hard*. But not impossible. Hence I infer that static
analysis tools still have room for improvement, and can make "mistakes".)

Ironically, defining PURIFY would hide this bug, because that disables the
use of arenas, instead allocating all bodies explicitly with malloc() and
releasing them with free(), and free() doesn't need to know the size of the
memory block, hence it wouldn't matter that the code had that size wrong.

2 years agoDon't clear the flag bit SVf_OOK in hv_undef_flags()
Nicholas Clark [Wed, 10 Nov 2021 10:29:13 +0000 (10:29 +0000)]
Don't clear the flag bit SVf_OOK in hv_undef_flags()

Now that HvAUX(hv) is allocated as part of the HV's body, it's imperative
to retain the flag that indicates which size of body has been allocated.

Otherwise, if we clear the flag, sv_clear() believes that the body is the
smaller of the two possible sizes, and so returns it to the correct arena
for that body size. This doesn't result in out-of-bounds memory reads, or
even memory leaks (when full cleanup runs with PERL_DESTRUCT_LEVEL=2),
because all bodies are still correctly tracked. However, without this bug
fixed, code that takes the same hash and repeatedly

1) assigns entries
2) iterates the hash
3) undef %hash

will request one new (larger) hash body for each iteration of the loop,
but each time return it to the arena for the smaller hash bodies, with the
result that the interpreter will steadily request ever more memory for
arenas for larger hash bodies, until memory is exhausted.

2 years agoDocument the HV aux struct free/release logic in hv_undef_flags()
Nicholas Clark [Thu, 18 Nov 2021 08:44:45 +0000 (08:44 +0000)]
Document the HV aux struct free/release logic in hv_undef_flags()

struct xpvhv_aux holds 4 pointers which can point to memory which needs
explicit release - document how hv_undef_flags() is directly responsible
for freeing xhv_mro_meta, indirectly responsible for freeing xhv_eiter,
and by implication can't free xhv_backreference or xhv_name_u.

2 years agoutf8.c: Rmv duplicate #define.
Karl Williamson [Sat, 18 Dec 2021 14:13:25 +0000 (07:13 -0700)]
utf8.c: Rmv duplicate #define.

This code is identical to a few lines above it

2 years agoUpdate ExtUtils-MakeMaker to CPAN version 7.64
Chris 'BinGOs' Williams [Sat, 18 Dec 2021 12:44:39 +0000 (12:44 +0000)]
Update ExtUtils-MakeMaker to CPAN version 7.64

  [DELTA]

7.64  Fri 17 Dec 15:35:46 GMT 2021

    No changes since v7.63_11

7.63_11 Tue 14 Dec 16:00:11 GMT 2021

    OS390 fixes:
    - Extend prereqs sort to work on EBCDIC

7.63_10 Mon 13 Dec 16:26:49 GMT 2021

    OS390 fixes:
    - Fix dynamic loading

7.63_09 Wed  8 Dec 22:20:53 GMT 2021

    Enhancements:
    - Don't use canned libpth values

7.63_08 Sat 27 Nov 17:28:03 GMT 2021

    Correction:
    - Previous change to ${LDFLAGS) was reverted

7.63_07 Sat 27 Nov 11:34:12 GMT 2021

    Enhancements:
    - Add $(LDFLAGS) when linking binary modules

7.63_06 Wed  3 Nov 01:24:05 GMT 2021

    Bug fixes:
    - Add -rpath when compiling XS modules on macOS

7.63_05 Sat 14 Aug 09:04:08 BST 2021

    Enhancements:
    - Added CPPRUN variable

7.63_04 Wed 30 Jun 15:15:01 BST 2021

    Doc fixes:
    - Describe CCFLAGS’ default

7.63_03 Tue 22 Jun 14:39:32 BST 2021

    OS390 Enhancements:
    - Fix override xs_make_dynamic_lib() for os390

7.63_02 Thu  3 Jun 19:52:03 BST 2021

    Doc fixes:
    - Changed wording for POLLUTE

7.63_01 Tue 25 May 16:22:50 BST 2021

    Bug fixes:
    - Comparing inodes numerically is unsafe

2 years agofix struct ioinfo definition for Mingw
Tomasz Konojacki [Thu, 16 Dec 2021 20:15:56 +0000 (21:15 +0100)]
fix struct ioinfo definition for Mingw

The "#ifndef _SAFECRT_IMPL" part made sense only for no longer
supported versions of Visual C++, but
92ca2349051b948d915e3fc721e3cbb97e7271e2 has accidentally exposed it
to Mingw builds.

2 years agoMark keywords.{c,h} as linguist-generated in .gitattributes
Paul "LeoNerd" Evans [Thu, 16 Dec 2021 18:21:09 +0000 (18:21 +0000)]
Mark keywords.{c,h} as linguist-generated in .gitattributes

2 years agoperlapio: binmode() and apply_layers() require pTHX
Karl Williamson [Thu, 29 Jul 2021 14:48:12 +0000 (08:48 -0600)]
perlapio: binmode() and apply_layers() require pTHX

These two functions, unlike all the rest,  require the thread context
parameter to be explicitly passed.  This commit makes the  documentation
be accurate.

2 years ago_MSC_VER is now always >= 1800 (i.e. Visual C++ 2013, aka Visual C++ 12.0)
Steve Hay [Fri, 5 Nov 2021 09:38:42 +0000 (09:38 +0000)]
_MSC_VER is now always >= 1800 (i.e. Visual C++ 2013, aka Visual C++ 12.0)

2 years agoMinor RMG tweaks
Richard Leach [Mon, 22 Nov 2021 20:46:41 +0000 (20:46 +0000)]
Minor RMG tweaks

2 years agoMinor output tweaks to sync-with-cpan
Richard Leach [Mon, 22 Nov 2021 21:14:56 +0000 (21:14 +0000)]
Minor output tweaks to sync-with-cpan

2 years agoAlso fix paren-less calls of subs where a filehandle could be
Dagfinn Ilmari Mannsåker [Sat, 11 Dec 2021 13:14:27 +0000 (13:14 +0000)]
Also fix paren-less calls of subs where a filehandle could be

If a sub exists, it takes precedence over the filehandle
interpretation even without the parens:

    $ perl  -le 'sub foo { "bar" } print foo;'
    bar

2 years agoFix function calls being misinterpreted as bareword filehandles
Dagfinn Ilmari Mannsåker [Fri, 10 Dec 2021 23:57:14 +0000 (23:57 +0000)]
Fix function calls being misinterpreted as bareword filehandles

When bareword filehandles are disabled, the parser was interpreting
any bareword as a filehandle, even when immediatey followed by parens:

    $ perl -M-feature=bareword_filehandles -le 'print foo()'
    Bareword filehandle "foo" not allowed under 'no feature "bareword_filehandles"' at -e line 1.

While with the feature enabled, it works and prints the value returned
by the function:

    $ perl  -le 'sub foo { @_ } print foo("bar")'
    bar

As for filehandles versus functions, a space before the parens makes
the difference:

    $ perl -le 'print STDOUT ("bar")'
    bar
    $ perl -le 'print STDOUT("bar")'
    Undefined subroutine &main::STDOUT called at -e line 1.

This fixes the bug by using the already-existing "immediate_paren"
variable to make it consistent when the feature is disabled.

Fixes #19271

2 years agoModernise File::Compare a little
James Raspass [Sun, 5 Dec 2021 21:12:47 +0000 (21:12 +0000)]
Modernise File::Compare a little

 - Move the version to the package line and bump it.
 - Bump use version now that we're using package NAME VER.
 - Drop strict now that we get it from use version.
 - Switch to non-inheritance based Exporter usage.
 - Use defined-or operator.

2 years agoperltie: Fix variable name in TIEHASH example
Jakub Wilk [Mon, 13 Dec 2021 15:04:52 +0000 (16:04 +0100)]
perltie: Fix variable name in TIEHASH example

2 years agoMerge branch 'builtin-in-core-libs' into blead
Paul "LeoNerd" Evans [Tue, 14 Dec 2021 22:33:34 +0000 (22:33 +0000)]
Merge branch 'builtin-in-core-libs' into blead

2 years agot/op/switch.t no longer needs to avoid overload.pm on miniperl 19269/head
Paul "LeoNerd" Evans [Fri, 10 Dec 2021 15:51:37 +0000 (15:51 +0000)]
t/op/switch.t no longer needs to avoid overload.pm on miniperl

2 years agoFix indirect call of ->import
Paul "LeoNerd" Evans [Thu, 9 Dec 2021 18:36:53 +0000 (18:36 +0000)]
Fix indirect call of ->import

2 years agoNo need for avoiding overload in File::Copy
Paul "LeoNerd" Evans [Wed, 8 Dec 2021 13:17:27 +0000 (13:17 +0000)]
No need for avoiding overload in File::Copy

2 years agoUse builtin::blessed() in overload.pm rather than using Scalar::Util
Paul "LeoNerd" Evans [Wed, 8 Dec 2021 11:42:47 +0000 (11:42 +0000)]
Use builtin::blessed() in overload.pm rather than using Scalar::Util

2 years agoUse builtin::reftype in ext/
Paul "LeoNerd" Evans [Thu, 9 Dec 2021 18:03:09 +0000 (18:03 +0000)]
Use builtin::reftype in ext/

2 years agoPorting/makerel: Don't reinvent a function
Karl Williamson [Tue, 14 Dec 2021 16:50:37 +0000 (09:50 -0700)]
Porting/makerel: Don't reinvent a function

It turns out the functionality here duplicates a pre-existing tool,
which this commit converts to use instead.

2 years agoPorting/makrel: White space only
Karl Williamson [Tue, 14 Dec 2021 16:53:31 +0000 (09:53 -0700)]
Porting/makrel: White space only

2 years agoPorting/makerel: Add xlation of UTF-16 files
Karl Williamson [Mon, 5 Jul 2021 07:31:06 +0000 (01:31 -0600)]
Porting/makerel: Add xlation of UTF-16 files

2 years agoPorting/makerel: Avoid hardcoding UTF-EBCDICS
Karl Williamson [Mon, 5 Jul 2021 07:21:26 +0000 (01:21 -0600)]
Porting/makerel: Avoid hardcoding UTF-EBCDICS

Instead, this uses the fundamental constants and derived values copied
from utf8.h, making things shorter

2 years agoPorting/makerel: White-space/comment only
Karl Williamson [Mon, 5 Jul 2021 07:15:53 +0000 (01:15 -0600)]
Porting/makerel: White-space/comment only

Prepare for a future commit that will add a surrounding block.

2 years agoPorting/makerel: Add use strict/warnings
Karl Williamson [Mon, 5 Jul 2021 06:53:02 +0000 (00:53 -0600)]
Porting/makerel: Add use strict/warnings

2 years agoPorting/makerel Make EBCDIC files writable
Karl Williamson [Fri, 2 Jul 2021 15:33:47 +0000 (09:33 -0600)]
Porting/makerel Make EBCDIC files writable

Some of them need to be changed after generation

2 years agot/TEST: white space only
Karl Williamson [Tue, 14 Dec 2021 15:11:20 +0000 (08:11 -0700)]
t/TEST: white space only

2 years agot/TEST: print Skip msg for EBCDIC skipped tests
Karl Williamson [Tue, 14 Dec 2021 15:06:53 +0000 (08:06 -0700)]
t/TEST: print Skip msg for EBCDIC skipped tests