Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit eb1e3b0

Browse files
committed
Release cperl-5.27.0
Highlights: * study HASH CODE ARRAY with hash shrink. * much faster HASH split (10^8x faster, which is measurable even if not often used) * strict hashpairs * on BOM set utf8 and unicode_strings * Safer perl -c:s cmdline flag * Faster glob * dtraces probes for hash and globs * Initial pgcc compiler support * Support long paths (>4096) * Many mingw and cygwin fixes. Changes: * Add strict hashpairs to perlfunc.pod MAP and perldata.pod List value constructors. * Simplify MSVC deploy, no powershell smoke * Adjust cygwin/mingw install+pkg deploy
1 parent fb9f0ac commit eb1e3b0

File tree

5 files changed

+93
-47
lines changed

5 files changed

+93
-47
lines changed

appveyor.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ build_script:
7373
- if "%CYGWIN%"=="1" sh ./Configure -des -Dusedevel & make
7474

7575
test_script:
76-
- ps: if ($env:MSVC_VERSION -gt 0) {
77-
$A = Start-Process -FilePath .\t\appveyor-smoke.bat -Wait -passthru;$a.ExitCode }
76+
- ps: if ($env:MSVC_VERSION -gt 0) { $env:MSVC = 1 }
77+
- if "%MSVC%"=="1" t\appveyor-smoke.bat
7878
- if "%CYGWIN%"=="1" make -s test
7979
- if "%MINGW%"=="1" make -s -C win32 %MKOPT% test
8080

8181
before_deploy:
82-
- if "%CYGWIN%"=="1" %CYGR%\bin\sh -lc "cd $APPVEYOR_BUILD_FOLDER; make install DESTDIR=/cygdrive/c/projects/cperl/inst && tar cvfj ${APPVEYOR_REPO_TAG_NAME}-cygwin-${platform}.tar.bz2 -C /cygdrive/c/projects/cperl/inst"
83-
- if "%MINGW%"=="1" sh -lc "cd $APPVEYOR_BUILD_FOLDER; make install DESTDIR=/c/projects/cperl/inst && tar cvfj ${APPVEYOR_REPO_TAG_NAME}-mingw-${platform}.tar.bz2 -C /c/projects/cperl/inst"
82+
- if "%CYGWIN%"=="1" %CYGR%\bin\sh -lc "cd $APPVEYOR_BUILD_FOLDER; make install DESTDIR=/cygdrive/c/projects/cperl/inst && cd /cygdrive/c/projects/cperl/inst && tar Jcvf ${APPVEYOR_REPO_TAG_NAME}-cygwin-${platform}.tar.xz *"
83+
- if "%MINGW%"=="1" sh -lc "cd $APPVEYOR_BUILD_FOLDER; make install DESTDIR=/c/projects/cperl/inst && cd /c/projects/cperl/inst && tar Jcvf ${APPVEYOR_REPO_TAG_NAME}-mingw-${platform}.tar.xz *"
8484

8585
# appveyor cannot glob * in names
8686
artifacts:
@@ -96,16 +96,16 @@ artifacts:
9696
- path: $(APPVEYOR_REPO_TAG_NAME)-win64.exe
9797
name: tagged-64
9898
type: exe
99-
- path: $(APPVEYOR_REPO_TAG_NAME)-cygwin-x86.tar.bz2
99+
- path: $(APPVEYOR_REPO_TAG_NAME)-cygwin-x86.tar.xz
100100
name: cygwin-32
101101
type: tar
102-
- path: $(APPVEYOR_REPO_TAG_NAME)-cygwin-x64.tar.bz2
102+
- path: $(APPVEYOR_REPO_TAG_NAME)-cygwin-x64.tar.xz
103103
name: cygwin-64
104104
type: tar
105-
- path: $(APPVEYOR_REPO_TAG_NAME)-mingw-x86.tar.bz2
105+
- path: $(APPVEYOR_REPO_TAG_NAME)-mingw-x86.tar.xz
106106
name: mingw-32
107107
type: tar
108-
- path: $(APPVEYOR_REPO_TAG_NAME)-mingw-x64.tar.bz2
108+
- path: $(APPVEYOR_REPO_TAG_NAME)-mingw-x64.tar.xz
109109
name: mingw-64
110110
type: tar
111111

@@ -121,13 +121,13 @@ deploy:
121121
force_update: true
122122
on:
123123
branch: /(master|relprep|cperl-tag-deploy-test)/
124-
MSVC_VERSION: 12
125124
- provider: GitHub
126125
tag: $(APPVEYOR_REPO_TAG_NAME)-win
127126
description: 'cperl windows sfx tagged (msvcr120.dll)'
128127
auth_token:
129128
secure: AsIAOIgCJX0QhrUKal2V00aaB5nRWtmtFTFeDVsGnbJLeEQpv9avUp0HT1cA8bNs
130-
artifact: tagged-32,tagged-64,cygwin-32,cygwin-64,mingw-32,mingw-64
129+
artifact: tagged-32,tagged-64,cygwin-32,cygwin-64
130+
#artifact: tagged-32,tagged-64,cygwin-32,cygwin-64,mingw-32,mingw-64
131131
draft: true
132132
force_update: true
133133
on:

pod/perlcdelta.pod

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,17 @@ L<perldtrace/"glob/gv call statistics"> sections.
189189

190190
=back
191191

192+
=head3 L<perldata>, L<perlfunc>
193+
194+
=over 4
195+
196+
=item *
197+
198+
Added new pairwise hash contruction limitations to L<perldata/"List
199+
value constructors"> and L<perlfunc/"map EXPR,LIST">.
200+
201+
=back
202+
192203
=head1 Diagnostics
193204

194205
The following additions or changes have been made to diagnostic output,

pod/perldata.pod

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,12 +1018,30 @@ This can be used to provide overridable configuration defaults:
10181018
# values in %args take priority over %config_defaults
10191019
%config = (%config_defaults, %args);
10201020

1021+
1022+
Hashes need to be assigned from list pairs. Under C<use warnings 'misc'>
1023+
an odd number of list elements is warned with "Odd number of elements
1024+
in hash assignment". Since cperl 5.27 under C<use strict> hash assignment
1025+
from lists must be from pairs, and from map even from an empty or
1026+
single pair only.
1027+
1028+
{
1029+
no strict;
1030+
my %h = (0..2); # warning
1031+
my %h = map {$_} (0..1); # warning
1032+
}
1033+
{
1034+
use strict;
1035+
my %h = (0..2); # error
1036+
my %h = map {$_} (0..1); # error
1037+
my %h = map {$_=>1, $_+1=>1} (0..1); # error
1038+
}
1039+
10211040
=head2 Subscripts
10221041

1023-
An array can be accessed one scalar at a
1024-
time by specifying a dollar sign (C<$>), then the
1025-
name of the array (without the leading C<@>), then the subscript inside
1026-
square brackets. For example:
1042+
An array can be accessed one scalar at a time by specifying a dollar
1043+
sign (C<$>), then the name of the array (without the leading C<@>),
1044+
then the subscript inside square brackets. For example:
10271045

10281046
@myarray = (5, 50, 500, 5000);
10291047
print "The Third Element is", $myarray[2], "\n";

pod/perlfunc.pod

Lines changed: 49 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3427,9 +3427,9 @@ relatives. In particular, it is not limited to using regular expressions.
34273427

34283428
Evaluates the BLOCK or EXPR for each element of LIST (locally setting
34293429
L<C<$_>|perlvar/$_> to each element) and returns the list value
3430-
consisting of those
3431-
elements for which the expression evaluated to true. In scalar
3432-
context, returns the number of times the expression was true.
3430+
consisting of those elements for which the expression evaluated to
3431+
true. In scalar context, returns the number of times the expression
3432+
was true.
34333433

34343434
my @foo = grep(!/^#/, @bar); # weed out comments
34353435

@@ -3438,15 +3438,14 @@ or equivalently,
34383438
my @foo = grep {!/^#/} @bar; # weed out comments
34393439

34403440
Note that L<C<$_>|perlvar/$_> is an alias to the list value, so it can
3441-
be used to
3442-
modify the elements of the LIST. While this is useful and supported,
3443-
it can cause bizarre results if the elements of LIST are not variables.
3444-
Similarly, grep returns aliases into the original list, much as a for
3445-
loop's index variable aliases the list elements. That is, modifying an
3446-
element of a list returned by grep (for example, in a C<foreach>,
3447-
L<C<map>|/map BLOCK LIST> or another L<C<grep>|/grep BLOCK LIST>)
3448-
actually modifies the element in the original list.
3449-
This is usually something to be avoided when writing clear code.
3441+
be used to modify the elements of the LIST. While this is useful and
3442+
supported, it can cause bizarre results if the elements of LIST are
3443+
not variables. Similarly, grep returns aliases into the original
3444+
list, much as a for loop's index variable aliases the list elements.
3445+
That is, modifying an element of a list returned by grep (for example,
3446+
in a C<foreach>, L<C<map>|/map BLOCK LIST> or another L<C<grep>|/grep
3447+
BLOCK LIST>) actually modifies the element in the original list. This
3448+
is usually something to be avoided when writing clear code.
34503449

34513450
If C<$_> is lexical in the scope where the C<grep> appears, because it has
34523451
been declared with C<my $_>, then, in addition to being locally aliased to
@@ -4076,12 +4075,11 @@ X<map>
40764075
=for Pod::Functions apply a change to a list to get back a new list with the changes
40774076

40784077
Evaluates the BLOCK or EXPR for each element of LIST (locally setting
4079-
L<C<$_>|perlvar/$_> to each element) and returns the list value composed
4080-
of the
4081-
results of each such evaluation. In scalar context, returns the
4082-
total number of elements so generated. Evaluates BLOCK or EXPR in
4083-
list context, so each element of LIST may produce zero, one, or
4084-
more elements in the returned value.
4078+
L<C<$_>|perlvar/$_> to each element) and returns the list value
4079+
composed of the results of each such evaluation. In scalar context,
4080+
returns the total number of elements so generated. Evaluates BLOCK or
4081+
EXPR in list context, so each element of LIST may produce zero, one,
4082+
or more elements in the returned value.
40854083

40864084
my @chars = map(chr, @numbers);
40874085

@@ -4122,21 +4120,21 @@ clearer in most cases. See also L<C<grep>|/grep BLOCK LIST> for a
41224120
list composed of those items of the original list for which the BLOCK
41234121
or EXPR evaluates to true.
41244122

4125-
If C<$_> is lexical in the scope where the C<map> appears (because it has
4126-
been declared with the deprecated C<my $_> construct),
4127-
then, in addition to being locally aliased to
4128-
the list elements, C<$_> keeps being lexical inside the block; that is, it
4129-
can't be seen from the outside, avoiding any potential side-effects.
4130-
4131-
C<{> starts both hash references and blocks, so C<map { ...> could be either
4132-
the start of map BLOCK LIST or map EXPR, LIST. Because Perl doesn't look
4133-
ahead for the closing C<}> it has to take a guess at which it's dealing with
4134-
based on what it finds just after the
4135-
C<{>. Usually it gets it right, but if it
4136-
doesn't it won't realize something is wrong until it gets to the C<}> and
4137-
encounters the missing (or unexpected) comma. The syntax error will be
4138-
reported close to the C<}>, but you'll need to change something near the C<{>
4139-
such as using a unary C<+> or semicolon to give Perl some help:
4123+
If C<$_> is lexical in the scope where the C<map> appears (because it
4124+
has been declared with the deprecated C<my $_> construct), then, in
4125+
addition to being locally aliased to the list elements, C<$_> keeps
4126+
being lexical inside the block; that is, it can't be seen from the
4127+
outside, avoiding any potential side-effects.
4128+
4129+
C<{> starts both hash references and blocks, so C<map { ...> could be
4130+
either the start of map BLOCK LIST or map EXPR, LIST. Because Perl
4131+
doesn't look ahead for the closing C<}> it has to take a guess at
4132+
which it's dealing with based on what it finds just after the C<{>.
4133+
Usually it gets it right, but if it doesn't it won't realize something
4134+
is wrong until it gets to the C<}> and encounters the missing (or
4135+
unexpected) comma. The syntax error will be reported close to the
4136+
C<}>, but you'll need to change something near the C<{> such as using
4137+
a unary C<+> or semicolon to give Perl some help:
41404138

41414139
my %hash = map { "\L$_" => 1 } @array # perl guesses EXPR. wrong
41424140
my %hash = map { +"\L$_" => 1 } @array # perl guesses BLOCK. right
@@ -4154,6 +4152,24 @@ or to force an anon hash constructor use C<+{>:
41544152

41554153
to get a list of anonymous hashes each with only one entry apiece.
41564154

4155+
Assignment to hashes is stricter under use L<strict> with the default
4156+
C<'hashpairs'> in cperl. Without strict hashpairs the list elements
4157+
constructed in the block can be of arbitrary size, only under C<use
4158+
warnings 'misc'> an odd number of elements is warned about. With
4159+
strict hashpairs the list elements constructed in the block can only
4160+
be an empty pair or a single pair, but not an odd number and not
4161+
multiple pairs. I<cperl only>
4162+
4163+
use strict; my %h = map{ $_ } @_;
4164+
4165+
=> Error: Only pair in map hash assignment allowed while "strict
4166+
hashpairs", got 1 elements
4167+
4168+
use strict; my %h = map{$_ => 1, $_+1 => 2} (0..1);
4169+
4170+
=> Error: Only pair in map hash assignment allowed while "strict
4171+
hashpairs", got 4 elements
4172+
41574173
=item mkdir FILENAME,MASK
41584174
X<mkdir> X<md> X<directory, create>
41594175

t/appveyor-smoke.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ nmake test CCTYPE=MSVC120 USE_NO_REGISTRY=define || exit /b
3232

3333
rem install on master/relprep/tag
3434
if "%APPVEYOR_REPO_TAG%" == "true" goto tag
35+
echo branch %APPVEYOR_REPO_BRANCH%
3536
if "%APPVEYOR_REPO_BRANCH%" == "master" goto nightly
3637
if "%APPVEYOR_REPO_BRANCH%" == "smoke/relprep" goto nightly
3738
if "%APPVEYOR_REPO_BRANCH%" == "cperl-tag-deploy-test" goto nightly

0 commit comments

Comments
 (0)