Commit | Line | Data |
---|---|---|
44691e6f AB |
1 | =encoding utf8 |
2 | ||
3 | =head1 NAME | |
4 | ||
fc4c3cec | 5 | perldelta - what is new for perl v5.23.1 |
eabfc7bc | 6 | |
2cfe9b50 | 7 | =head1 DESCRIPTION |
eabfc7bc | 8 | |
fc4c3cec | 9 | This document describes differences between the 5.23.0 release and the 5.23.1 |
2cfe9b50 | 10 | release. |
eabfc7bc | 11 | |
fc4c3cec RS |
12 | If you are upgrading from an earlier release such as 5.22.0, first read |
13 | L<perl5230delta>, which describes differences between 5.22.0 and 5.23.0. | |
14 | ||
2cfe9b50 | 15 | =head1 Core Enhancements |
eabfc7bc | 16 | |
fb7e9cdd | 17 | =head2 Integer shift (C<< << >> and C<< >> >>) now more explicitly defined |
deaaea8c JH |
18 | |
19 | Negative shifts are reverse shifts: left shift becomes right shift, | |
20 | and right shift becomes left shift. | |
21 | ||
22 | Shifting by the number of bits in a native integer (or more) is zero, | |
23 | except when the "overshift" is right shifting a negative value under | |
24 | C<use integer>, in which case the result is -1 (arithmetic shift). | |
25 | ||
26 | Until now negative shifting and overshifting have been undefined | |
27 | because they have relied on whatever the C implementation happens | |
fb7e9cdd | 28 | to do. For example, for the overshift a common C behavior is |
deaaea8c JH |
29 | "modulo shift": |
30 | ||
31 | 1 >> 64 == 1 >> (64 % 64) == 1 >> 0 == 1 # Common C behavior. | |
32 | ||
33 | # And the same for <<, while Perl now produces 0 for both. | |
34 | ||
35 | Now these behaviors are well-defined under Perl, regardless of what | |
36 | the underlying C implementation does. Note, however, that you cannot | |
fb7e9cdd JH |
37 | escape the native integer width, you need to know how far left you |
38 | can go. You can use for example: | |
39 | ||
40 | use Config; | |
41 | my $wordbits = $Config{uvsize} * 8; # Or $Config{uvsize} << 3. | |
42 | ||
43 | If you need a more bits on the left shift, you can use for example | |
44 | the C<bigint> pragma, or the C<Bit::Vector> module from CPAN. | |
deaaea8c | 45 | |
7d380357 RS |
46 | =head2 Postfix dereferencing is no longer experimental |
47 | ||
1c2511e0 AC |
48 | Using the C<postderef> and C<postderef_qq> features no longer emits a |
49 | warning. Existing code that disables the C<experimental::postderef> warning | |
50 | category that they previously used will continue to work. The C<postderef> | |
51 | feature has no effect; all Perl code can use postfix dereferencing, | |
52 | regardless of what feature declarations are in scope. The C<5.24> feature | |
53 | bundle now includes the C<postderef_qq> feature. | |
7d380357 | 54 | |
0d610ac1 AC |
55 | =head2 printf and sprintf now allow reordered precision arguments |
56 | ||
57 | That is, C<< sprintf '|%.*2$|', 2, 3 >> now returns C<|002|>. This extends | |
58 | the existing reordering mechanism (which allows reordering for arguments | |
59 | that are used as format fields, widths, and vector separators). | |
60 | ||
2cfe9b50 | 61 | =head1 Incompatible Changes |
eabfc7bc | 62 | |
ce4793f1 KW |
63 | =head2 ASCII characters in variable names must now be all visible |
64 | ||
65 | It was legal until now on ASCII platforms for variable names to contain | |
66 | non-graphical ASCII control characters (ordinals 0 through 31, and 127, | |
67 | which are the C0 controls and C<DELETE>). This usage has been | |
68 | deprecated since v5.20, and as of now causes a syntax error. The | |
69 | variables these names referred to are special, reserved by Perl for | |
70 | whatever use it may choose, now, or in the future. Each such variable | |
71 | has an alternative way of spelling it. Instead of the single | |
72 | non-graphic control character, a two character sequence beginning with a | |
73 | caret is used, like C<$^]> and C<${^GLOBAL_PHASE}>. Details are at | |
74 | L<perlvar>. It remains legal, though unwise and deprecated (raising a | |
75 | deprecation warning), to use certain non-graphic non-ASCII characters in | |
76 | variables names when not under S<C<use utf8>>. No code should do this, | |
77 | as all such variables are reserved by Perl, and Perl doesn't currently | |
78 | define any of them (but could at any time, without notice). | |
eabfc7bc | 79 | |
26230909 AC |
80 | =head2 The C<autoderef> feature has been removed |
81 | ||
82 | The experimental C<autoderef> feature (which allowed calling C<push>, | |
83 | C<pop>, C<shift>, C<unshift>, C<splice>, C<keys>, C<values>, and C<each> on | |
84 | a scalar argument) has been deemed unsuccessful. It has now been removed; | |
85 | trying to use the feature (or to disable the C<experimental::autoderef> | |
86 | warning it previously triggered) now yields an exception. | |
87 | ||
fc4c3cec | 88 | =head1 Deprecations |
eabfc7bc | 89 | |
fc4c3cec RS |
90 | =head2 Module removals |
91 | ||
92 | XXX Remove this section if inapplicable. | |
93 | ||
94 | The following modules will be removed from the core distribution in a | |
95 | future release, and will at that time need to be installed from CPAN. | |
96 | Distributions on CPAN which require these modules will need to list them as | |
97 | prerequisites. | |
98 | ||
99 | The core versions of these modules will now issue C<"deprecated">-category | |
100 | warnings to alert you to this fact. To silence these deprecation warnings, | |
101 | install the modules in question from CPAN. | |
102 | ||
103 | Note that these are (with rare exceptions) fine modules that you are encouraged | |
104 | to continue to use. Their disinclusion from core primarily hinges on their | |
105 | necessity to bootstrapping a fully functional, CPAN-capable Perl installation, | |
106 | not usually on concerns over their design. | |
107 | ||
108 | =over | |
109 | ||
110 | =item XXX | |
111 | ||
112 | XXX Note that deprecated modules should be listed here even if they are listed | |
113 | as an updated module in the L</Modules and Pragmata> section. | |
114 | ||
115 | =back | |
116 | ||
117 | [ List each other deprecation as a =head2 entry ] | |
118 | ||
fc4c3cec | 119 | =head1 Modules and Pragmata |
eabfc7bc | 120 | |
fc4c3cec RS |
121 | XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/> |
122 | go here. If Module::CoreList is updated, generate an initial draft of the | |
123 | following sections using F<Porting/corelist-perldelta.pl>. A paragraph summary | |
124 | for important changes should then be added by hand. In an ideal world, | |
125 | dual-life modules would have a F<Changes> file that could be cribbed. | |
eabfc7bc | 126 | |
fc4c3cec | 127 | [ Within each section, list entries as a =item entry ] |
eabfc7bc | 128 | |
fc4c3cec | 129 | =head2 New Modules and Pragmata |
eabfc7bc | 130 | |
fc4c3cec | 131 | =over 4 |
eabfc7bc | 132 | |
73d6481e | 133 | =item * |
eabfc7bc | 134 | |
fc4c3cec | 135 | XXX |
eabfc7bc | 136 | |
fc4c3cec | 137 | =back |
eabfc7bc | 138 | |
fc4c3cec RS |
139 | =head2 Updated Modules and Pragmata |
140 | ||
141 | =over 4 | |
eabfc7bc RS |
142 | |
143 | =item * | |
144 | ||
dc013420 SH |
145 | L<autodie> has been upgraded from version 2.28 to 2.29. |
146 | ||
147 | =item * | |
148 | ||
c85f23b2 DD |
149 | L<IPC::Open3> has been upgraded from version 1.18 to 1.19. |
150 | ||
151 | If a Perl exception was thrown from inside this module, the exception | |
779c45ce | 152 | C<IPC::Open3> threw to the callers of C<open3> would have an irrelevant |
c85f23b2 DD |
153 | message derived from C<$!> which was in an undefined state, instead of the |
154 | C<$@> message which triggers the failure path inside C<open3>. | |
eabfc7bc | 155 | |
6962a25d SH |
156 | =item * |
157 | ||
158 | L<Unicode::Collate> has been upgraded from version 1.12 to 1.14. | |
159 | ||
0b8e4842 SH |
160 | =item * |
161 | ||
162 | L<Unicode::Normalize> has been upgraded from version 1.18 to 1.19. | |
163 | ||
fc4c3cec RS |
164 | =back |
165 | ||
166 | =head2 Removed Modules and Pragmata | |
eabfc7bc | 167 | |
fc4c3cec | 168 | =over 4 |
374c951f SH |
169 | |
170 | =item * | |
171 | ||
fc4c3cec | 172 | XXX |
e586de20 | 173 | |
fc4c3cec | 174 | =back |
e586de20 | 175 | |
fc4c3cec | 176 | =head1 Diagnostics |
b7b593d8 | 177 | |
fc4c3cec RS |
178 | The following additions or changes have been made to diagnostic output, |
179 | including warnings and fatal error messages. For the complete list of | |
180 | diagnostic messages, see L<perldiag>. | |
b7b593d8 | 181 | |
fc4c3cec RS |
182 | =head2 Changes to Existing Diagnostics |
183 | ||
fc4c3cec | 184 | =over 4 |
4b951711 TC |
185 | |
186 | =item * | |
187 | ||
0d610ac1 AC |
188 | The C<printf> and C<sprintf> builtins are now more careful about the |
189 | warnings they emit: argument reordering now disables the "redundant | |
190 | argument" warning in all cases; and invalid format strings are no longer | |
191 | treated as absorbing arguments (so "redundant argument" warnings can | |
192 | correctly be emitted by such code). | |
eabfc7bc | 193 | |
fc4c3cec | 194 | =back |
eabfc7bc | 195 | |
73d6481e | 196 | =head1 Platform Support |
eabfc7bc | 197 | |
fc4c3cec | 198 | =head2 Platform-Specific Notes |
9c0328ac | 199 | |
fc4c3cec RS |
200 | =over 4 |
201 | ||
7d380357 | 202 | =item VMS |
fc4c3cec | 203 | |
7d380357 RS |
204 | =over |
205 | ||
206 | =item * | |
207 | ||
208 | The minimum supported version of VMS is now v7.3-2, released in 2003. As a | |
209 | side effect of this change, VAX is no longer supported as the terminal | |
210 | release of OpenVMS VAX was v7.3 in 2001. | |
211 | ||
212 | =back | |
eabfc7bc | 213 | |
2cfe9b50 | 214 | =back |
eabfc7bc | 215 | |
fc4c3cec RS |
216 | =head1 Internal Changes |
217 | ||
2cfe9b50 | 218 | =over 4 |
eabfc7bc RS |
219 | |
220 | =item * | |
221 | ||
0d610ac1 AC |
222 | C<sv_catpvf> and related functions (including C<sv_vcatpvfn_flags> when |
223 | called with a C<va_list> rather than an array of SV pointers) have never | |
224 | handled argument reordering. Attempts to reorder arguments now yield an | |
225 | exception, rather than being silently ignored. | |
eabfc7bc | 226 | |
fc4c3cec | 227 | =back |
302ef3d4 | 228 | |
fc4c3cec | 229 | =head1 Selected Bug Fixes |
302ef3d4 | 230 | |
fc4c3cec | 231 | =over 4 |
eabfc7bc | 232 | |
73d6481e | 233 | =item * |
eabfc7bc | 234 | |
7ed1d857 DD |
235 | A leak in the XS typemap caused one scalar to be leaked each time a C<FILE *> |
236 | or a C<PerlIO *> was C<OUTPUT:>ed or imported to Perl, since perl 5.000. These | |
237 | particular typemap entries are thought to be extremely rarely used by XS | |
238 | modules. [perl #124181] | |
eabfc7bc | 239 | |
fc4c3cec | 240 | =item * |
2a7a05b4 | 241 | |
2ad3e690 MH |
242 | C<alarm()> and C<sleep()> will now warn if the argument is a negative number |
243 | and return undef. Previously they would pass the negative value to the | |
244 | underlying C function which may have set up a timer with a surprising value. | |
30aa8e3f | 245 | |
fc4c3cec | 246 | =back |
30aa8e3f | 247 | |
fc4c3cec | 248 | =head1 Acknowledgements |
2a7a05b4 | 249 | |
fc4c3cec | 250 | XXX Generate this with: |
2cfe9b50 | 251 | |
fc4c3cec | 252 | perl Porting/acknowledgements.pl v5.23.1..HEAD |
f5b73711 | 253 | |
44691e6f AB |
254 | =head1 Reporting Bugs |
255 | ||
e08634c5 SH |
256 | If you find what you think is a bug, you might check the articles recently |
257 | posted to the comp.lang.perl.misc newsgroup and the perl bug database at | |
fc4c3cec RS |
258 | L<https://rt.perl.org/> . There may also be information at |
259 | L<http://www.perl.org/> , the Perl Home Page. | |
44691e6f | 260 | |
e08634c5 SH |
261 | If you believe you have an unreported bug, please run the L<perlbug> program |
262 | included with your release. Be sure to trim your bug down to a tiny but | |
263 | sufficient test case. Your bug report, along with the output of C<perl -V>, | |
264 | will be sent off to perlbug@perl.org to be analysed by the Perl porting team. | |
44691e6f AB |
265 | |
266 | If the bug you are reporting has security implications, which make it | |
e08634c5 SH |
267 | inappropriate to send to a publicly archived mailing list, then please send it |
268 | to perl5-security-report@perl.org. This points to a closed subscription | |
269 | unarchived mailing list, which includes all the core committers, who will be | |
270 | able to help assess the impact of issues, figure out a resolution, and help | |
f9001595 | 271 | co-ordinate the release of patches to mitigate or fix the problem across all |
e08634c5 SH |
272 | platforms on which Perl is supported. Please only use this address for |
273 | security issues in the Perl core, not for modules independently distributed on | |
274 | CPAN. | |
44691e6f AB |
275 | |
276 | =head1 SEE ALSO | |
277 | ||
e08634c5 SH |
278 | The F<Changes> file for an explanation of how to view exhaustive details on |
279 | what changed. | |
44691e6f AB |
280 | |
281 | The F<INSTALL> file for how to build Perl. | |
282 | ||
283 | The F<README> file for general stuff. | |
284 | ||
285 | The F<Artistic> and F<Copying> files for copyright information. | |
286 | ||
287 | =cut |