This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add created_as_... builtins to perldelta
[perl5.git] / pod / perl53510delta.pod
CommitLineData
78684fb7
S
1=encoding utf8
2
3=head1 NAME
4
5perl53510delta - what is new for perl v5.35.10
6
7=head1 DESCRIPTION
8
9This document describes differences between the 5.35.9 release and the 5.35.10
10release.
11
12If you are upgrading from an earlier release such as 5.35.8, first read
13L<perl5359delta>, which describes differences between 5.35.8 and 5.35.9.
14
15=head1 Core Enhancements
16
17=head2 New function C<builtin::trim>
18
19This function treats its argument as a string, returning the result of
20removing all white space at its beginning and ending. See
21L<builtin/trim>
22
23=head2 Variable length lookbehind is mostly no longer considered experimental.
24
25Prior to this release any form of variable length lookbehind was
26considered experimental. With this release the experimental status has
27been reduced to cover only lookbehind that contains capturing parenthesis.
28This is because it is not clear if
29
30 "aaz"=~/(?=z)(?<=(a|aa))/
31
32should match and leave $1 equaling "a" or "aa". Currently it will match
33the longest possible alternative, "aa". We are confident that the overall
34construct will now match only when it should, we are not confident that we
35will keep the current "longest match" behavior.
36
37=head2 Added 'builtin::indexed'
38
39A new function has been added to the C<builtin> package, called C<indexed>.
40It returns a list twice as big as its argument list, where each item is
41preceded by its index within that list. This is primarily useful for using
42the new C<foreach> syntax with multiple iterator variables to iterate over
43an array or list, while also tracking the index of each item:
44
45 use builtin 'indexed';
46
47 foreach my ($index, $val) (indexed @array) {
48 ...
49 }
50
51=head2 Added experimental feature 'extra_paired_delimiters'
52
53Perl traditionally has allowed just four pairs of string/pattern
54delimiters: S<C<( )>> S<C<{ }>> S<C<[ ]>> and S<C<< < > >>>, all in the
55ASCII range. Unicode has hundreds more possibilities, and using this
56feature enables many of them. When enabled, you can say S<C<qr« »>> for
278812ac 57example, or S<C<use utf8; q𝄃string𝄂>>. See
78684fb7
S
58L<feature/The 'extra_paired_delimiters' feature> for
59details.
60
61=head1 Performance Enhancements
62
63=over 4
64
65=item *
66
67Large hashes no longer allocate their keys from the shared string table.
68
69The same internal datatype (C<PVHV>) is used for all of
70
71=over 4
72
73=item *
74
75Symbol tables
76
77=item *
78
79Objects (by default)
80
81=item *
82
83Associative arrays
84
85=back
86
87The shared string table was originally added to improve performance for blessed
88hashes used as objects, because every object instance has the same keys, so it
89is an optimisation to share memory between them. It also makes sense for symbol
90tables, where derived classes will have the same keys (typically method names),
91and the OP trees built for method calls can also share memory. The shared
92string table behaves roughly like a cache for hash keys.
93
94But for hashes actually used as associative arrays - mapping keys to values -
95typically the keys are not re-used in other hashes. For example, "seen" hashes
96are keyed by object IDs (or addresses), and logically these keys won't repeat
97in other hashes.
98
99Storing these "used just once" keys in the shared string table increases CPU
100and RAM use for no gain. For such keys the shared string table behaves as a
101cache with a 0% hit rate. Storing all the keys there increases the total size
102of the shared string table, as well as increasing the number of times it is
103resized as it grows. B<Worse> - in any environment that has "copy on write"
104memory for child process (such as a pre-forking server), the memory pages used
105for the shared string table rapidly need to be copied as the child process
106manipulates hashes. Hence if most of the shared string table is such keys that
107are used only in one place, there is no benefit from re-use within the perl
108interpreter, but a high cost due to more pages for the OS to copy.
109
110The perl interpreter now disables shared hash keys for "large" hashes (that are
111neither objects nor symbol tables). "Large" is a heuristic - currently the
112heuristic is that sharing is disabled when adding a key to a hash triggers
113allocation of more storage, and the hash has more than 42 keys.
114
115This B<might> cause slightly increased memory usage for programs that create
116(unblessed) data structures that contain multiple large hashes that share the
117same keys. But generally our testing suggests that for the specific cases
118described it is a win, and other code is unaffected.
119
120=back
121
122=head1 Modules and Pragmata
123
124=head2 Updated Modules and Pragmata
125
126=over 4
127
128=item *
129
130L<Attribute::Handlers> has been upgraded from version 1.01 to 1.02.
131
132=item *
133
134L<B::Deparse> has been upgraded from version 1.62 to 1.63.
135
136=item *
137
138L<DB_File> has been upgraded from version 1.856 to 1.857.
139
140=item *
141
142L<Devel::PPPort> has been upgraded from version 3.64 to 3.68.
143
144=item *
145
146L<experimental> has been upgraded from version 0.027 to 0.028.
147
148=item *
149
150L<ExtUtils::ParseXS> has been upgraded from version 3.44 to 3.45.
151
152=item *
153
154L<ExtUtils::Typemaps> has been upgraded from version 3.44 to 3.45.
155
156=item *
157
158L<feature> has been upgraded from version 1.70 to 1.71.
159
160=item *
161
162L<File::Spec> has been upgraded from version 3.83 to 3.84.
163
164=item *
165
166L<GDBM_File> has been upgraded from version 1.22 to 1.23.
167
168=item *
169
170L<Module::CoreList> has been upgraded from version 5.20220220 to 5.20220320.
171
172=item *
173
174L<Opcode> has been upgraded from version 1.56 to 1.57.
175
176=item *
177
178L<Scalar::Util> has been upgraded from version 1.61 to 1.62.
179
180=item *
181
182L<Test::Simple> has been upgraded from version 1.302188 to 1.302190.
183
184=item *
185
186L<warnings> has been upgraded from version 1.57 to 1.58.
187
188=item *
189
190L<XS::APItest> has been upgraded from version 1.21 to 1.22.
191
192=back
193
194=head1 Documentation
195
196=head2 Changes to Existing Documentation
197
198We have attempted to update the documentation to reflect the changes
199listed in this document. If you find any we have missed, open an issue
200at L<https://github.com/Perl/perl5/issues>.
201
202=head1 Diagnostics
203
204The following additions or changes have been made to diagnostic output,
205including warnings and fatal error messages. For the complete list of
206diagnostic messages, see L<perldiag>.
207
208=head2 New Diagnostics
209
210=head3 New Errors
211
212=over 4
213
214=item *
215
216L<Wide character in $0|perldiag/"Wide character in %s">
217
218Attempts to put wide characters into the program name (C<$0>) now
219provoke this warning.
220
221=back
222
223=head2 Changes to Existing Diagnostics
224
225=over 4
226
227=item * New 'scalar' category for "Useless use of sort in scalar context"
228
229When C<sort> is used in scalar context, it provokes a warning that this is not
230useful. This warning used to be in the C<void> category. A new category for
231warnings about scalar context has now been added, called C<scalar>.
232
233=back
234
235=head1 Internal Changes
236
237=over 4
238
239=item *
240
241C<sv_dump> (and L<Devel::Peek>’s C<Dump> function) now escapes high-bit
242octets in the PV as hex rather than octal. Since most folks understand hex
243more readily than octal, this should make these dumps a bit more legible.
244This does B<not> affect any other diagnostic interfaces like C<pv_display>.
245
246=back
247
248=head1 Acknowledgements
249
250Perl 5.35.10 represents approximately 4 weeks of development since Perl
2515.35.9 and contains approximately 15,000 lines of changes across 300 files
252from 26 authors.
253
254Excluding auto-generated files, documentation and release tools, there were
255approximately 6,900 lines of changes to 190 .pm, .t, .c and .h files.
256
257Perl continues to flourish into its fourth decade thanks to a vibrant
258community of users and developers. The following people are known to have
259contributed the improvements that became Perl 5.35.10:
260
261Bernd, Brad Barden, Chad Granum, cuishuang, Curtis Poe, Dagfinn Ilmari
262Mannsåker, Daniel Laügt, Felipe Gasper, Graham Knop, Hugo van der Sanden,
263James E Keenan, Karl Williamson, Leon Timmermans, Matthew Horsfall, Michiel
264Beijen, Nicholas Clark, Nicolas R, Paul Evans, Renee Baecker, Ricardo
265Signes, Richard Leach, Sawyer X, Sisyphus, Steve Hay, TAKAI Kousuke, Yves
266Orton.
267
268The list above is almost certainly incomplete as it is automatically
269generated from version control history. In particular, it does not include
270the names of the (very much appreciated) contributors who reported issues to
271the Perl bug tracker.
272
273Many of the changes included in this version originated in the CPAN modules
274included in Perl's core. We're grateful to the entire CPAN community for
275helping Perl to flourish.
276
277For a more complete list of all of Perl's historical contributors, please
278see the F<AUTHORS> file in the Perl source distribution.
279
280=head1 Reporting Bugs
281
282If you find what you think is a bug, you might check the perl bug database
283at L<https://github.com/Perl/perl5/issues>. There may also be information at
284L<http://www.perl.org/>, the Perl Home Page.
285
286If you believe you have an unreported bug, please open an issue at
287L<https://github.com/Perl/perl5/issues>. Be sure to trim your bug down to a
288tiny but sufficient test case.
289
290If the bug you are reporting has security implications which make it
291inappropriate to send to a public issue tracker, then see
292L<perlsec/SECURITY VULNERABILITY CONTACT INFORMATION>
293for details of how to report the issue.
294
295=head1 Give Thanks
296
297If you wish to thank the Perl 5 Porters for the work we had done in Perl 5,
298you can do so by running the C<perlthanks> program:
299
300 perlthanks
301
302This will send an email to the Perl 5 Porters list with your show of thanks.
303
304=head1 SEE ALSO
305
306The F<Changes> file for an explanation of how to view exhaustive details on
307what changed.
308
309The F<INSTALL> file for how to build Perl.
310
311The F<README> file for general stuff.
312
313The F<Artistic> and F<Copying> files for copyright information.
314
315=cut