1 |
|
2 |
=encoding utf8 |
3 |
|
4 |
=head1 NAME |
5 |
|
6 |
=begin original |
7 |
|
8 |
perl5160delta - what is new for perl v5.16.0 |
9 |
|
10 |
=end original |
11 |
|
12 |
perl5160delta - perl v5.16.0 での変更点 |
13 |
|
14 |
=head1 DESCRIPTION |
15 |
|
16 |
=begin original |
17 |
|
18 |
This document describes differences between the 5.14.0 release and |
19 |
the 5.16.0 release. |
20 |
|
21 |
=end original |
22 |
|
23 |
この文書は 5.14.0 リリースと 5.16.0 リリースの変更点を記述しています。 |
24 |
|
25 |
=begin original |
26 |
|
27 |
If you are upgrading from an earlier release such as 5.12.0, first read |
28 |
L<perl5140delta>, which describes differences between 5.12.0 and |
29 |
5.14.0. |
30 |
|
31 |
=end original |
32 |
|
33 |
5.12.0 のような以前のリリースから更新する場合は、まず 5.12.0 と |
34 |
5.14.0 の違いについて記述している L<perl5140delta> を読んでください。 |
35 |
|
36 |
=head1 Notice |
37 |
|
38 |
=begin original |
39 |
|
40 |
XXX Any important notices here |
41 |
|
42 |
=end original |
43 |
|
44 |
|
45 |
=head1 Core Enhancements |
46 |
|
47 |
(コアの拡張) |
48 |
|
49 |
=head2 C<use I<VERSION>> |
50 |
|
51 |
=begin original |
52 |
|
53 |
As of this release, version declarations like C<use v5.16> now disable |
54 |
all features before enabling the new feature bundle. This means that |
55 |
the following holds true: |
56 |
|
57 |
=end original |
58 |
|
59 |
このリリース以降、C<use v5.16> のようなバージョン宣言は、新しい機能が |
60 |
有効になる前の全ての機能が無効になるようになりました。 |
61 |
これは、以下のようなものが真であることを意味します: |
62 |
|
63 |
use 5.016; |
64 |
# only 5.16 features enabled here |
65 |
use 5.014; |
66 |
# only 5.14 features enabled here (not 5.16) |
67 |
|
68 |
=begin original |
69 |
|
70 |
C<use v5.12> and higher continue to enable strict, but explicit C<use |
71 |
strict> and C<no strict> now override the version declaration, even |
72 |
when they come first: |
73 |
|
74 |
=end original |
75 |
|
76 |
C<use v5.12> 以上は strict を有効にするという機能ははそのままですが、 |
77 |
明示的な C<use strict> と C<no strict> は (先に現れても) バージョン定義を |
78 |
上書きするようになりました: |
79 |
|
80 |
no strict; |
81 |
use 5.012; |
82 |
# no strict here |
83 |
|
84 |
=begin original |
85 |
|
86 |
There is a new ":default" feature bundle that represents the set of |
87 |
features enabled before any version declaration or C<use feature> has |
88 |
been seen. Version declarations below 5.10 now enable the ":default" |
89 |
feature set. This does not actually change the behaviour of C<use |
90 |
v5.8>, because features added to the ":default" set are those that were |
91 |
traditionally enabled by default, before they could be turned off. |
92 |
|
93 |
=end original |
94 |
|
95 |
新しい ":default" 機能は、任意のバージョン定義や C<use feature> が |
96 |
現れる前に有効な機能の集合を表現します。 |
97 |
5.10 以前のバージョン宣言は ":default" 機能集合を有効にするように |
98 |
なりました。 |
99 |
これは実際には C<use v5.8> の振る舞いを変更しません; なぜなら |
100 |
":default" 集合は、機能を無効に出来るようになる前に伝統的にデフォルトで |
101 |
有効になっていたものだからです。 |
102 |
|
103 |
=begin original |
104 |
|
105 |
C<< no feature >> now resets to the default feature set. To disable all |
106 |
features (which is likely to be a pretty special-purpose request, since |
107 |
it presumably won't match any named set of semantics) you can now |
108 |
write C<< no feature ':all' >>. |
109 |
|
110 |
=end original |
111 |
|
112 |
C<< no feature >> はデフォルト機能集合をリセットするようになりました。 |
113 |
全ての機能を無効にする (これはかなり特殊な用途の要求です; なぜなら |
114 |
おそらく動作の全ての名前付き集合にマッチングしないからです) には、 |
115 |
C<< no feature ':all' >> と書けるようになります。 |
116 |
|
117 |
=begin original |
118 |
|
119 |
C<$[> is now disabled under C<use v5.16>. It is part of the default |
120 |
feature set and can be turned on or off explicitly with C<use feature |
121 |
'array_base'>. |
122 |
|
123 |
=end original |
124 |
|
125 |
C<$[> は C<use v5.16> の元では無効になるようになりました。 |
126 |
これはデフォルト機能集合の一部で、 C<use feature 'array_base'> によって |
127 |
明示的に有効無効を切り替えられます。 |
128 |
|
129 |
=head2 C<__SUB__> |
130 |
|
131 |
=begin original |
132 |
|
133 |
The new C<__SUB__> token, available under the C<current_sub> feature |
134 |
(see L<feature>) or C<use v5.16>, returns a reference to the current |
135 |
subroutine, making it easier to write recursive closures. |
136 |
|
137 |
=end original |
138 |
|
139 |
C<current_sub> 機能 (L<feature> 参照) または C<use v5.16> で利用可能な |
140 |
C<__SUB__> トークンは現在のサブルーチンへのリファレンスを返すことで、 |
141 |
再帰クロージャを書くのを容易にします。 |
142 |
|
143 |
=head2 New and Improved Built-ins |
144 |
|
145 |
(新規または改良された組み込み関数) |
146 |
|
147 |
=head3 More consistent C<eval> |
148 |
|
149 |
(より一貫性のある C<eval>) |
150 |
|
151 |
=begin original |
152 |
|
153 |
The C<eval> operator sometimes treats a string argument as a sequence of |
154 |
characters and sometimes as a sequence of bytes, depending on the |
155 |
internal encoding. The internal encoding is not supposed to make any |
156 |
difference, but there is code that relies on this inconsistency. |
157 |
|
158 |
=end original |
159 |
|
160 |
C<eval> 演算子は内部エンコーディングに依存して、時には文字列引数を |
161 |
文字の並びとして、時にはバイトの並びとして扱います。 |
162 |
内部エンコーディングは何の違いもないはずですが、この非一貫性に依存した |
163 |
コードがあります。 |
164 |
|
165 |
=begin original |
166 |
|
167 |
The new C<unicode_eval> and C<evalbytes> features (enabled under C<use |
168 |
5.16.0>) resolve this. The C<unicode_eval> feature causes C<eval |
169 |
$string> to treat the string always as Unicode. The C<evalbytes> |
170 |
features provides a function, itself called C<evalbytes>, which |
171 |
evaluates its argument always as a string of bytes. |
172 |
|
173 |
=end original |
174 |
|
175 |
(C<use 5.16.0> で有効になる)新しい C<unicode_eval> 機能と |
176 |
C<evalbytes> 機能はこれを解決します。 |
177 |
C<unicode_eval> 機能は、C<eval $string> での文字列を常に Unicode として |
178 |
扱います。 |
179 |
C<evalbytes> 機能は、引数を常にバイト列として扱う C<evalbytes> 関数を |
180 |
提供します。 |
181 |
|
182 |
=begin original |
183 |
|
184 |
These features also fix oddities with source filters leaking to outer |
185 |
dynamic scopes. |
186 |
|
187 |
=end original |
188 |
|
189 |
これらの機能は、ソースフィルタが外側の動的スコープにリークする問題も |
190 |
修正します。 |
191 |
|
192 |
=begin original |
193 |
|
194 |
See L<feature> for more detail. |
195 |
|
196 |
=end original |
197 |
|
198 |
さらなる詳細については L<feature> を参照してください。 |
199 |
|
200 |
=head3 C<substr> lvalue revamp |
201 |
|
202 |
(C<substr> 左辺値の刷新) |
203 |
|
204 |
=for comment Does this belong here, or under Incomptable Changes? |
205 |
|
206 |
=begin original |
207 |
|
208 |
When C<substr> is called in lvalue or potential lvalue context with two |
209 |
or three arguments, a special lvalue scalar is returned that modifies |
210 |
the original string (the first argument) when assigned to. |
211 |
|
212 |
=end original |
213 |
|
214 |
左辺値や潜在的な左辺値コンテキストで 2 引数または 3 引数の C<substr> が |
215 |
呼び出されると、代入するときに元の文字列(1 番目の引数)を修正する |
216 |
特殊な左辺値スカラを返します。 |
217 |
|
218 |
=begin original |
219 |
|
220 |
Previously, the offsets (the second and third arguments) passed to |
221 |
C<substr> would be converted immediately to match the string, negative |
222 |
offsets being translated to positive and offsets beyond the end of the |
223 |
string being truncated. |
224 |
|
225 |
=end original |
226 |
|
227 |
以前は、C<substr> に渡されたオフセット(2 番目と 3 番目の引数) は直ちに |
228 |
文字列にマッチするように変換され、負のオフセットは正に変換され、 |
229 |
文字列の末尾を越えるオフセットは切り詰められました。 |
230 |
|
231 |
=begin original |
232 |
|
233 |
Now, the offsets are recorded without modification in the special |
234 |
lvalue scalar that is returned, and the original string is not even |
235 |
looked at by C<substr> itself, but only when the returned lvalue is |
236 |
read or modified. |
237 |
|
238 |
=end original |
239 |
|
240 |
今では、オフセットは返される特殊左辺値スカラに修正なしに記録され、 |
241 |
元の文字列は C<substr> 自身によっても見ませんが、返された左辺値は |
242 |
読んだり修正したりしたときだけです。 |
243 |
|
244 |
=begin original |
245 |
|
246 |
These changes result in an incompatible change: |
247 |
|
248 |
=end original |
249 |
|
250 |
これらの変更はいくつかの互換性のない変更を引き起こします: |
251 |
|
252 |
=begin original |
253 |
|
254 |
If the original string changes length after the call to C<substr> but |
255 |
before assignment to its return value, negative offsets will remember |
256 |
their position from the end of the string, affecting code like this: |
257 |
|
258 |
=end original |
259 |
|
260 |
C<substr> を呼び出した後、返り値が代入される前に、元の文字列の長さが |
261 |
変更されると、負のオフセットは文字列の末尾からの位置を覚えているので、 |
262 |
以下のようなコードに影響を与えます: |
263 |
|
264 |
my $string = "string"; |
265 |
my $lvalue = \substr $string, -4, 2; |
266 |
print $lvalue, "\n"; # prints "ri" |
267 |
$string = "bailing twine"; |
268 |
print $lvalue, "\n"; # prints "wi"; used to print "il" |
269 |
|
270 |
=begin original |
271 |
|
272 |
The same thing happens with an omitted third argument. The returned |
273 |
lvalue will always extend to the end of the string, even if the string |
274 |
becomes longer. |
275 |
|
276 |
=end original |
277 |
|
278 |
同じことは省略された 3 番目の引数でも起こります。 |
279 |
返された左辺値は、たとえ文字列が長くなっても、常に文字列の末尾に |
280 |
拡張されます。 |
281 |
|
282 |
=begin original |
283 |
|
284 |
Since this change also allowed many bugs to be fixed (see |
285 |
L</Fixes to the C<substr> operator>), and since the behaviour |
286 |
of negative offsets has never been specified, so the |
287 |
change was deemed acceptable. |
288 |
|
289 |
=end original |
290 |
|
291 |
Since this change also allowed many bugs to be fixed (see |
292 |
L</Fixes to the C<substr> operator>), |
293 |
負数のオフセットの振る舞いは仕様になったことはないので、この変更は |
294 |
受け入れられる取引でした。 |
295 |
(TBT) |
296 |
|
297 |
=head3 Return value of C<tied> |
298 |
|
299 |
(C<tied> の返り値) |
300 |
|
301 |
=begin original |
302 |
|
303 |
The value returned by C<tied> on a tied variable is now the actual |
304 |
scalar that holds the object to which the variable is tied. This |
305 |
allows ties to be weakened with C<Scalar::Util::weaken(tied |
306 |
$tied_variable)>. |
307 |
|
308 |
=end original |
309 |
|
310 |
tie された変数に対する C<tied> によって返される値は、変数が tie された |
311 |
オブジェクトを保持する実際のスカラになりました。 |
312 |
これにより C<Scalar::Util::weaken(tied $tied_variable)> で tie を |
313 |
弱めることが出来るようになります。 |
314 |
|
315 |
=head2 Unicode Support |
316 |
|
317 |
(Unicode 対応) |
318 |
|
319 |
=head3 Supports (I<almost>) Unicode 6.1 |
320 |
|
321 |
((I<ほぼ>) Unicode 6.1 対応) |
322 |
|
323 |
=begin original |
324 |
|
325 |
Besides the addition of whole new scripts, and new characters in |
326 |
existing scripts, this new version of Unicode, as always, makes some |
327 |
changes to existing characters. One change that may trip up some |
328 |
applications is that the General Category of two characters in the |
329 |
Latin-1 range, PILCROW SIGN and SECTION SIGN, has been changed from |
330 |
Other_Symbol to Other_Punctuation. The same change has been made for |
331 |
a character in each of Tibetan, Ethiopic, and Aegean. |
332 |
The code points U+3248..U+324F (CIRCLED NUMBER TEN ON BLACK SQUARE |
333 |
through CIRCLED NUMBER EIGHTY ON BLACK SQUARE) have had their General |
334 |
Category changed from Other_Symbol to Other_Numeric. The Line Break |
335 |
property has changes for Hebrew and Japanese; and as a consequence of |
336 |
other changes in 6.1, the Perl regular expression construct C<\X> now |
337 |
works differently for some characters in Thai and Lao. |
338 |
|
339 |
=end original |
340 |
|
341 |
完全に新しい用字や、既にある用字への新しい文字の他に、新しい |
342 |
Unicode はいつも通り、既にある文字もいくつか変更しています。 |
343 |
アプリケーションをつまずかせるかもしれない変更の一つは、 |
344 |
Latin-1 の範囲にある二つの文字 PILCROW SIGN および SECTION SIGN の |
345 |
一般カテゴリは Other_Symbol から Other_Punctuation に変更されました。 |
346 |
同じ変更は Tibetan, Ethiopic, Aegean の文字に対しても行われました。 |
347 |
符号位置 U+3248..U+324F (CIRCLED NUMBER TEN ON BLACK SQUARE から |
348 |
CIRCLED NUMBER EIGHTY ON BLACK SQUARE) の一般カテゴリは |
349 |
Other_Symbol から Other_Numeric に変更されました。 |
350 |
Line Break 特性は Hebrew と Japanese で変更されました; そして 6.1 での |
351 |
その他の変更の結果として、Perl の正規表現構造 C<\X> は Thai と Lao の |
352 |
いくつかの文字では異なった動作をします。 |
353 |
|
354 |
=begin original |
355 |
|
356 |
New aliases (synonyms) have been defined for many property values; |
357 |
these, along with the previously existing ones, are all cross-indexed in |
358 |
L<perluniprops>. |
359 |
|
360 |
=end original |
361 |
|
362 |
新しい別名が多くの特性値に定義されました; これらは、既に存在するものと |
363 |
あわせて、全て L<perluniprops> にクロスインデックスされています。 |
364 |
|
365 |
=begin original |
366 |
|
367 |
The return value of C<charnames::viacode()> is affected by other |
368 |
changes: |
369 |
|
370 |
=end original |
371 |
|
372 |
C<charnames::viacode()> の帰り値はその他の変更の影響を受けます: |
373 |
|
374 |
Code point Old Name New Name |
375 |
U+000A LINE FEED (LF) LINE FEED |
376 |
U+000C FORM FEED (FF) FORM FEED |
377 |
U+000D CARRIAGE RETURN (CR) CARRIAGE RETURN |
378 |
U+0085 NEXT LINE (NEL) NEXT LINE |
379 |
U+008E SINGLE-SHIFT 2 SINGLE-SHIFT-2 |
380 |
U+008F SINGLE-SHIFT 3 SINGLE-SHIFT-3 |
381 |
U+0091 PRIVATE USE 1 PRIVATE USE-1 |
382 |
U+0092 PRIVATE USE 2 PRIVATE USE-2 |
383 |
U+2118 SCRIPT CAPITAL P WEIERSTRASS ELLIPTIC FUNCTION |
384 |
|
385 |
=begin original |
386 |
|
387 |
Perl will accept any of these names as input, but |
388 |
C<charnames::viacode()> now returns the new name of each pair. The |
389 |
change for U+2118 is considered by Unicode to be a correction, that is |
390 |
the original name was a mistake (but again, it will remain forever valid |
391 |
to use it to refer to U+2118). But most of these changes are the |
392 |
fallout of the mistake Unicode 6.0 made in naming a character used in |
393 |
Japanese cell phones to be "BELL", which conflicts with the longstanding |
394 |
industry use of (and Unicode's recommendation to use) that name |
395 |
to mean the ASCII control character at U+0007. As a result, that name |
396 |
has been deprecated in Perl since v5.14; and any use of it will raise a |
397 |
warning message (unless turned off). The name "ALERT" is now the |
398 |
preferred name for this code point, with "BEL" being an acceptable short |
399 |
form. The name for the new cell phone character, at code point U+1F514, |
400 |
remains undefined in this version of Perl (hence we don't quite |
401 |
implement all of Unicode 6.1), but starting in v5.18, BELL will mean |
402 |
this character, and not U+0007. |
403 |
|
404 |
=end original |
405 |
|
406 |
Perl は任意の名前を入力として受け付けますが、C<charnames::viacode()> は |
407 |
それぞれのペアの新しい名前を返すようになりました。 |
408 |
U+2118 の変更は、元の名前が間違っていたための Unicode による訂正と |
409 |
考えられます(しかし再び、これは U+2118 を参照するために永遠に有効の |
410 |
ままです)。 |
411 |
しかしこれらの変更の中で最大のものは、日本の携帯電話で使われている |
412 |
文字の名前に、長い間実用されている (そして Unicode も使用を推奨している |
413 |
ASCII 制御文字 U+0007 と衝突している "BELL" という名前を付けたことによる |
414 |
副産物です。 |
415 |
結果として、この名前は v5.14 以降 Perl では非推奨となっています; |
416 |
そしてこれを使うと(オフにしていなければ)警告メッセージが発生します。 |
417 |
この符号位置に対する適切な名前は "ALERT" になり、短い形式として |
418 |
"BEL" が受け入れられるようになります。 |
419 |
このバージョンの Perl では、符号位置 U+1F514 の新しい携帯電話の文字の |
420 |
名前は未定義のままです(従って私たちは Unicode 6.1 の完全に全てを |
421 |
実装しているわけではありません)が、v5.18 から BELL は U+0007 ではなく |
422 |
この文字を意味するようになります。 |
423 |
|
424 |
=begin original |
425 |
|
426 |
Unicode has taken steps to make sure that this sort of mistake does not |
427 |
happen again. The Standard now includes all the generally accepted |
428 |
names and abbreviations for control characters, whereas previously it |
429 |
didn't (though there were recommended names for most of them, which Perl |
430 |
used). This means that most of those recommended names are now |
431 |
officially in the Standard. Unicode did not recommend names for the |
432 |
four code points listed above between U+008E and U+008F, and in |
433 |
standardizing them Unicode subtly changed the names that Perl had |
434 |
previously given them, by replacing the final blank in each name by a |
435 |
hyphen. Unicode also officially accepts names that Perl had deprecated, |
436 |
such as FILE SEPARATOR. Now the only deprecated name is BELL. |
437 |
Finally, Perl now uses the new official names instead of the old |
438 |
(now considered obsolete) names for the first four code points in the |
439 |
list above (the ones which have the parentheses in them). |
440 |
|
441 |
=end original |
442 |
|
443 |
Unicode はこのような過ちが再び起きないようにするための対策を取りました。 |
444 |
今では標準には制御文字に対して、全ての一般的に受け入れられている名前を |
445 |
含むようになりました(以前は含んでいませんでしたが、そのほとんどは |
446 |
Perl が使っていた推奨される名前でした)。 |
447 |
Unicode は U+008E から U+008F の間の上述の四つの符号位置に対する |
448 |
名前を推奨しておらず、and in |
449 |
standardizing them Unicode subtly changed the names that Perl had |
450 |
previously given them, by replacing the final blank in each name by a |
451 |
hyphen. |
452 |
Unicode はまた、FILE SEPARATOR のように Perl では非推奨とした名前を |
453 |
公式に受け入れました。 |
454 |
今では唯一の非推奨の名前は BELL です。 |
455 |
最終的に、上述の四つの符号位置の名前として古い(今では古いものとなったと |
456 |
考えられる)名前ではなく、新しい公式の名前(かっこで囲まれたもの)を使います。 |
457 |
(TBT) |
458 |
|
459 |
=begin original |
460 |
|
461 |
Now that the names have been placed in the Unicode standard, these kinds |
462 |
of changes should not happen again, though corrections, such as to |
463 |
U+2118, are still possible. |
464 |
|
465 |
=end original |
466 |
|
467 |
名前が Unicode 標準に入ったことにより、この種の変更は再び発生することは |
468 |
ありませんが、U+2118 に対するような修正は引き続き起こりえます。 |
469 |
|
470 |
=begin original |
471 |
|
472 |
Unicode also added some name abbreviations, which Perl now accepts: |
473 |
SP for SPACE; |
474 |
TAB for CHARACTER TABULATION; |
475 |
NEW LINE, END OF LINE, NL, and EOL for LINE FEED; |
476 |
LOCKING-SHIFT ONE for SHIFT OUT; |
477 |
LOCKING-SHIFT ZERO for SHIFT IN; |
478 |
and ZWNBSP for ZERO WIDTH NO-BREAK SPACE. |
479 |
|
480 |
=end original |
481 |
|
482 |
Unicode はまたいくつかの名前の略称を追加し、Perl でも使えるようになりました: |
483 |
SPACE 用に SP; |
484 |
CHARACTER TABULATION 用に TAB; |
485 |
LINE FEED 用に NEW LINE, END OF LINE, NL, EOL; |
486 |
SHIFT OUT 用に LOCKING-SHIFT ONE; |
487 |
SHIFT IN 用に LOCKING-SHIFT ZERO; |
488 |
ZERO WIDTH NO-BREAK SPACE 用に ZWNBSP。 |
489 |
|
490 |
=begin original |
491 |
|
492 |
More details on this version of Unicode are provided in |
493 |
L<http://www.unicode.org/versions/Unicode6.1.0/>. |
494 |
|
495 |
=end original |
496 |
|
497 |
このバージョンの Unicode に関するさらなる詳細は |
498 |
L<http://www.unicode.org/versions/Unicode6.1.0/> で提供されています。 |
499 |
|
500 |
=head3 C<use charnames> is no longer needed for C<\N{I<name>}> |
501 |
|
502 |
(C<\N{I<name>}> には C<use charnames> は不要に) |
503 |
|
504 |
=begin original |
505 |
|
506 |
When C<\N{I<name>}> is encountered, the C<charnames> module is now |
507 |
automatically loaded when needed as if the C<:full> and C<:short> |
508 |
options had been specified. See L<charnames> for more information. |
509 |
|
510 |
=end original |
511 |
|
512 |
C<\N{I<name>}> に遭遇すると、必要なら C<:full> と C<:short> のオプションが |
513 |
指定されたかのように C<charnames> モジュールが自動的に読み込まれるように |
514 |
なりました。 |
515 |
さらなる情報については L<charnames> を参照してください。 |
516 |
|
517 |
=head3 C<\N{...}> can now have Unicode loose name matching |
518 |
|
519 |
(C<\N{...}> は Unicode の緩い名前のマッチングに) |
520 |
|
521 |
=begin original |
522 |
|
523 |
This is described in the C<charnames> item in |
524 |
L</Updated Modules and Pragmata> below. |
525 |
|
526 |
=end original |
527 |
|
528 |
これは後述する L</Updated Modules and Pragmata> の |
529 |
C<charnames> に記述されています。 |
530 |
|
531 |
=head3 Unicode Symbol Names |
532 |
|
533 |
(Unicode シンボル名) |
534 |
|
535 |
=begin original |
536 |
|
537 |
Perl now has proper support for Unicode in symbol names. It used to be |
538 |
that C<*{$foo}> would ignore the internal UTF8 flag and use the bytes of |
539 |
the underlying representation to look up the symbol. That meant that |
540 |
C<*{"\x{100}"}> and C<*{"\xc4\x80"}> would return the same thing. All |
541 |
these parts of Perl have been fixed to account for Unicode: |
542 |
|
543 |
=end original |
544 |
|
545 |
Perl はシンボル名に対する Unicode 対応を適切に行うようになりました。 |
546 |
今までは C<*{$foo}> は内部 UTF8フラグを無視して、基となっているバイト列を |
547 |
使います。 |
548 |
|
549 |
=over |
550 |
|
551 |
=item * |
552 |
|
553 |
=begin original |
554 |
|
555 |
Method names (including those passed to C<use overload>) |
556 |
|
557 |
=end original |
558 |
|
559 |
メソッド名 (C<use overload> に渡されるものも含みます) |
560 |
|
561 |
=item * |
562 |
|
563 |
=begin original |
564 |
|
565 |
Typeglob names (including names of variables, subroutines and filehandles) |
566 |
|
567 |
=end original |
568 |
|
569 |
型グロブ名 (変数、サブルーチン、ファイルハンドルの名前を含みます) |
570 |
|
571 |
=item * |
572 |
|
573 |
=begin original |
574 |
|
575 |
Package names |
576 |
|
577 |
=end original |
578 |
|
579 |
パッケージ名 |
580 |
|
581 |
=item * |
582 |
|
583 |
C<goto> |
584 |
|
585 |
=item * |
586 |
|
587 |
=begin original |
588 |
|
589 |
Symbolic dereferencing |
590 |
|
591 |
=end original |
592 |
|
593 |
シンボリックなデリファレンス |
594 |
|
595 |
=item * |
596 |
|
597 |
=begin original |
598 |
|
599 |
Second argument to C<bless()> and C<tie()> |
600 |
|
601 |
=end original |
602 |
|
603 |
C<bless()> と C<tie()> への第 2 引数 |
604 |
|
605 |
=item * |
606 |
|
607 |
=begin original |
608 |
|
609 |
Return value of C<ref()> |
610 |
|
611 |
=end original |
612 |
|
613 |
C<ref()> の返り値 |
614 |
|
615 |
=item * |
616 |
|
617 |
=begin original |
618 |
|
619 |
Subroutine prototypes |
620 |
|
621 |
=end original |
622 |
|
623 |
サブルーチンプロトタイプ |
624 |
|
625 |
=item * |
626 |
|
627 |
=begin original |
628 |
|
629 |
Attributes |
630 |
|
631 |
=end original |
632 |
|
633 |
属性 |
634 |
|
635 |
=item * |
636 |
|
637 |
=begin original |
638 |
|
639 |
Various warnings and error messages that mention variable names or values, |
640 |
methods, etc. |
641 |
|
642 |
=end original |
643 |
|
644 |
変数名や値、メソッドなどに言及する様々な警告やエラーメッセージ |
645 |
|
646 |
=back |
647 |
|
648 |
=begin original |
649 |
|
650 |
In addition, a parsing bug has been fixed that prevented C<*{é}> from |
651 |
implicitly quoting the name, but instead interpreted it as C<*{+é}>, which |
652 |
would cause a strict violation. |
653 |
|
654 |
=end original |
655 |
|
656 |
さらに、 |
657 |
a parsing bug has been fixed that prevented C<*{é}> from |
658 |
implicitly quoting the name, but instead interpreted it as C<*{+é}>, which |
659 |
would cause a strict violation. |
660 |
(TBT) |
661 |
|
662 |
=begin original |
663 |
|
664 |
C<*{"*a::b"}> automatically strips off the * if it is followed by an ASCII |
665 |
letter. That has been extended to all Unicode identifier characters. |
666 |
|
667 |
=end original |
668 |
|
669 |
C<*{"*a::b"}> は、* の後に ASCII 文字が引き続いている場合は * が自動的に |
670 |
削除されます。 |
671 |
これは全ての Unicode 識別子文字に拡張されました。 |
672 |
|
673 |
=begin original |
674 |
|
675 |
One-character non-ASCII non-punctuation variables (like C<$é>) are now |
676 |
subject to "Used only once" warnings. They used to be exempt, as they |
677 |
was treated as punctuation variables. |
678 |
|
679 |
=end original |
680 |
|
681 |
(C<$é> のような) 単一文字非 ASCII 非句読点変数はは |
682 |
"Used only once" 警告を出すようになりました。 |
683 |
今までは、これは句読点変数として扱われていたので警告から免れていました。 |
684 |
|
685 |
=begin original |
686 |
|
687 |
Also, single-character Unicode punctuation variables (like $‰) are now |
688 |
supported [perl #69032]. |
689 |
|
690 |
=end original |
691 |
|
692 |
また、($‰ のような)単一文字の Unicode 句読点変数に対応しました |
693 |
[perl #69032]。 |
694 |
|
695 |
=head3 Improved ability to mix locales and Unicode, including UTF-8 locales |
696 |
|
697 |
((UTF-8 ロケールを含む)ロケールと Unicode を混ぜる能力の改善) |
698 |
|
699 |
=begin original |
700 |
|
701 |
An optional parameter has been added to C<use locale> |
702 |
|
703 |
=end original |
704 |
|
705 |
C<use locale> にオプションの引数が追加されました: |
706 |
|
707 |
use locale ':not_characters'; |
708 |
|
709 |
=begin original |
710 |
|
711 |
which tells Perl to use all but the C<LC_CTYPE> and C<LC_COLLATE> |
712 |
portions of the current locale. Instead, the character set is assumed |
713 |
to be Unicode. This allows locales and Unicode to be seamlessly mixed, |
714 |
including the increasingly frequent UTF-8 locales. When using this |
715 |
hybrid form of locales, the C<:locale> layer to the L<open> pragma can |
716 |
be used to interface with the file system, and there are CPAN modules |
717 |
available for ARGV and environment variable conversions. |
718 |
|
719 |
=end original |
720 |
|
721 |
は、現在のロケールのうち、C<LC_CTYPE> と C<LC_COLLATE> 以外の全てを |
722 |
使うことを Perl に知らせます。 |
723 |
それ以外では、文字集合は Unicode であると仮定します。 |
724 |
これにより、徐々に頻繁に出てくる UTF-8 ロケールを含む、ロケールと |
725 |
Unicode をシームレスに混ぜることが出来るようになります。 |
726 |
このハイブリッド形式のロケールを使うとき、 |
727 |
L<open> への C<:locale> 層をファイルシステムへのインターフェースとして |
728 |
使うことができ、ARGV と環境変数の変換のための CPAN モジュールを |
729 |
利用可能です。 |
730 |
|
731 |
=begin original |
732 |
|
733 |
Full details are in L<perllocale>. |
734 |
|
735 |
=end original |
736 |
|
737 |
完全な詳細は L<perllocale> にあります。 |
738 |
|
739 |
=head3 New function C<fc> and corresponding escape sequence C<\F> for Unicode foldcase |
740 |
|
741 |
(Unicode 畳み込み文字のための新しい関数 C<fc> と対応するエスケープシーケンス C<\F>) |
742 |
|
743 |
=begin original |
744 |
|
745 |
Unicode foldcase is an extension to lowercase that gives better results |
746 |
when comparing two strings case-insensitively. It has long been used |
747 |
internally in regular expression C</i> matching. Now it is available |
748 |
explicitly through the new C<fc> function call (enabled by |
749 |
S<C<"use feature 'fc'">>, or C<use v5.16>, or explicitly callable via |
750 |
C<CORE::fc>) or through the new C<\F> sequence in double-quotish |
751 |
strings. |
752 |
|
753 |
=end original |
754 |
|
755 |
Unicode の畳み込み文字は、二つの文字列を大文字小文字を無視して比較するときに |
756 |
よりよい結果を与えるための小文字の拡張です。 |
757 |
これは長い間正規表現の C</i> マッチングで内部で使われていました。 |
758 |
これは (S<C<"use feature 'fc'">>、C<use v5.16> で有効にするか、 |
759 |
明示的な C<CORE::fc> で明示的に呼び出し可能な)新しい C<fc> 関数呼び出しか、 |
760 |
ダブルクォート風の文字列の中の新しい C<\F> シーケンスを通して |
761 |
利用可能になりました。 |
762 |
|
763 |
=begin original |
764 |
|
765 |
Full details are in L<perlfunc/fc>. |
766 |
|
767 |
=end original |
768 |
|
769 |
完全な詳細は L<perlfunc/fc> にあります。 |
770 |
|
771 |
=head3 The Unicode C<Script_Extensions> property is now supported. |
772 |
|
773 |
(Unicode の C<Script_Extensions> 特性に対応) |
774 |
|
775 |
=begin original |
776 |
|
777 |
New in Unicode 6.0, this is an improved C<Script> property. Details |
778 |
are in L<perlunicode/Scripts>. |
779 |
|
780 |
=end original |
781 |
|
782 |
Unicode 6.0 からの新機能で、これは改良された C<Script> 特性です。 |
783 |
詳細は L<perlunicode/Scripts> にあります。 |
784 |
|
785 |
=head2 XS Changes |
786 |
|
787 |
=head3 Improved typemaps for Some Builtin Types |
788 |
|
789 |
(いくつかの組み込み型の typemap の改善) |
790 |
|
791 |
=begin original |
792 |
|
793 |
Most XS authors will be aware that there is a longstanding bug in the |
794 |
OUTPUT typemap for T_AVREF (C<AV*>), T_HVREF (C<HV*>), T_CVREF (C<CV*>), |
795 |
and T_SVREF (C<SVREF> or C<\$foo>) that requires manually decrementing |
796 |
the reference count of the return value instead of the typemap taking |
797 |
care of this. For backwards-compatibility, this cannot be changed in the |
798 |
default typemaps. But we now provide additional typemaps |
799 |
C<T_AVREF_REFCOUNT_FIXED>, etc. that do not exhibit this bug. Using |
800 |
them in your extension is as simple as having one line in your |
801 |
C<TYPEMAP> section: |
802 |
|
803 |
=end original |
804 |
|
805 |
ほとんどの XS 作者は、will be aware that there is a longstanding bug in the |
806 |
OUTPUT typemap for T_AVREF (C<AV*>), T_HVREF (C<HV*>), T_CVREF (C<CV*>), |
807 |
and T_SVREF (C<SVREF> or C<\$foo>) that requires manually decrementing |
808 |
the reference count of the return value instead of the typemap taking |
809 |
care of this. |
810 |
後方互換性のために、これはデフォルトの typemap では変更できません。 |
811 |
しかし、この問題が含まれない |
812 |
C<T_AVREF_REFCOUNT_FIXED> などの追加の typemap を提供することになりました。 |
813 |
エクステンションでこれらを使うことで、 |
814 |
C<TYPEMAP> セクションを 1 行にまで単純化できます: |
815 |
(TBT) |
816 |
|
817 |
HV* T_HVREF_REFCOUNT_FIXED |
818 |
|
819 |
=head3 C<is_utf8_char()> |
820 |
|
821 |
=begin original |
822 |
|
823 |
The XS-callable function C<is_utf8_char()>, when presented with |
824 |
malformed UTF-8 input, can read up to 12 bytes beyond the end of the |
825 |
string. This cannot be fixed without changing its API. It is not |
826 |
called from CPAN. The documentation now describes how to use it |
827 |
safely. |
828 |
|
829 |
=end original |
830 |
|
831 |
XS 呼び出し可能な関数 C<is_utf8_char()> は、不正な UTF-8 入力があると、 |
832 |
文字列の終わりを越えて最大 12 バイト読む可能性があります。 |
833 |
これは API を変更せずに修正することはできません。 |
834 |
これは CPAN からは呼び出されません。 |
835 |
文書にはこれを安全に使う方法を記述しています。 |
836 |
|
837 |
=head3 Added C<is_utf8_char_buf()> |
838 |
|
839 |
(C<is_utf8_char_buf()> の追加) |
840 |
|
841 |
=begin original |
842 |
|
843 |
This function is designed to replace the deprecated L</is_utf8_char()> |
844 |
function. It includes an extra parameter to make sure it doesn't read |
845 |
past the end of the input buffer. |
846 |
|
847 |
=end original |
848 |
|
849 |
この関数は非推奨の L</is_utf8_char()> 関数を置き換えるために |
850 |
設計されています。 |
851 |
これには入力バッファの末尾を越えて読み込まないようにするための追加の引数が |
852 |
あります。 |
853 |
|
854 |
=head3 Other C<is_utf8_foo()> functions, as well as C<utf8_to_foo()>, etc. |
855 |
|
856 |
(C<utf8_to_foo()> のような、その他の C<is_utf8_foo()> 関数) |
857 |
|
858 |
=begin original |
859 |
|
860 |
Most of the other XS-callable functions that take UTF-8 encoded input |
861 |
implicitly assume that the UTF-8 is valid (not malformed) in regards to |
862 |
buffer length. Do not do things such as change a character's case or |
863 |
see if it is alphanumeric without first being sure that it is valid |
864 |
UTF-8. This can be safely done for a whole string by using one of the |
865 |
functions C<is_utf8_string()>, C<is_utf8_string_loc()>, and |
866 |
C<is_utf8_string_loclen()>. |
867 |
|
868 |
=end original |
869 |
|
870 |
UTF-8 エンコードされた入力を取るその他の XS 呼び出し可能な関数のほとんどは |
871 |
バッファ長に関して UTF-8 が有効である(不正でない)ことを暗黙に |
872 |
仮定しています。 |
873 |
まず文字列が有効な UTF-8 であることを確認せずに、文字の大文字小文字を |
874 |
変更したり、英数字かどうかを確認したりしてはいけません。 |
875 |
このようなことは、文字列全体に対して C<is_utf8_string()>, |
876 |
C<is_utf8_string_loc()>, C<is_utf8_string_loclen()> のいずれかを使うことで |
877 |
安全に行えます。 |
878 |
|
879 |
=head3 New Pad API |
880 |
|
881 |
(新しいパッド API) |
882 |
|
883 |
=begin original |
884 |
|
885 |
Many new functions have been added to the API for manipulating lexical |
886 |
pads. See L<perlapi/Pad Data Structures> for more information. |
887 |
|
888 |
=end original |
889 |
|
890 |
レキシカルパッドを操作するための多くの新しい関数が API に追加されました。 |
891 |
さらなる情報については L<perlapi/Pad Data Structures> を参照してください。 |
892 |
|
893 |
=head2 Changes to Special Variables |
894 |
|
895 |
(特殊変数に関する変更) |
896 |
|
897 |
=head3 C<$$> can be assigned to |
898 |
|
899 |
(C<$$> は代入可能に) |
900 |
|
901 |
=begin original |
902 |
|
903 |
C<$$> was made read-only in Perl 5.8.0. But only sometimes: C<local $$> |
904 |
would make it writable again. Some CPAN modules were using C<local $$> or |
905 |
XS code to bypass the read-only check, so there is no reason to keep C<$$> |
906 |
read-only. (This change also allowed a bug to be fixed while maintaining |
907 |
backward compatibility.) |
908 |
|
909 |
=end original |
910 |
|
911 |
C<$$> は Perl 5.8.0 で読み込みせんようになりました。 |
912 |
しかしときどき: C<local $$> で再び書き込み可能になることがあります。 |
913 |
CPAN モジュールによっては読み込み専用のチェックを回避するために |
914 |
C<local $$> や XS コードを使っているものもあるので、C<$$> よ読み込み専用に |
915 |
保っておく理由がありません。 |
916 |
(この変更はまた、過去互換性を維持する間に修正するべきバグを許します。) |
917 |
|
918 |
=head3 C<$^X> converted to an absolute path on FreeBSD, OS X and Solaris |
919 |
|
920 |
(FreeBSD, OS X, Solaris でも C<$^X> が絶対パスに変換されるように) |
921 |
|
922 |
=begin original |
923 |
|
924 |
C<$^X> is now converted to an absolute path on OS X, FreeBSD (without |
925 |
needing F</proc> mounted) and Solaris 10 and 11. This augments the |
926 |
previous approach of using F</proc> on Linux, FreeBSD and NetBSD |
927 |
(in all cases, where mounted). |
928 |
|
929 |
=end original |
930 |
|
931 |
C<$^X> は、OS X、(F</proc> をマウントする必要のない) FreeBSD、 |
932 |
Solaris 10 と 11 では絶対パスに変換されるようになりました。 |
933 |
これは Linux, FreeBSD, NetBSD で(マウントされているときに) |
934 |
F</proc> を使うという以前の手法を拡大します。 |
935 |
|
936 |
=begin original |
937 |
|
938 |
This makes relocatable perl installations more useful on these platforms. |
939 |
(See "Relocatable @INC" in F<INSTALL>) |
940 |
|
941 |
=end original |
942 |
|
943 |
これにより、これらのプラットフォームでの再配置可能な perl インストールが |
944 |
より便利になります。 |
945 |
(F<INSTALL> の "Relocatable @INC" を参照してください。) |
946 |
|
947 |
=head2 Debugger Changes |
948 |
|
949 |
(デバッガの変更) |
950 |
|
951 |
=head3 Features inside the debugger |
952 |
|
953 |
(デバッガ内部の機能) |
954 |
|
955 |
=begin original |
956 |
|
957 |
The current Perl's L<feature> bundle is now enabled for commands entered |
958 |
in the interactive debugger. |
959 |
|
960 |
=end original |
961 |
|
962 |
現在の Perl の L<feature> バンドルは、対話的デバッガで入力されたコマンドで |
963 |
有効になるようになりました。 |
964 |
|
965 |
=head3 New option for the debugger's B<t> command |
966 |
|
967 |
(デバッガの B<t> コマンドの新しいオプション) |
968 |
|
969 |
=begin original |
970 |
|
971 |
The B<t> command in the debugger, which toggles tracing mode, now |
972 |
accepts a numeric argument that determines how many levels of subroutine |
973 |
calls to trace. |
974 |
|
975 |
=end original |
976 |
|
977 |
トレースモードをトグルするデバッガの B<t> コマンドは、サブルーチン |
978 |
呼び出しを何レベルまでトレースするかを決定する数値引数を |
979 |
受け付けるようになりました。 |
980 |
|
981 |
=head3 C<enable> and C<disable> |
982 |
|
983 |
(C<enable> と C<disable>) |
984 |
|
985 |
=begin original |
986 |
|
987 |
The debugger now has C<disable> and C<enable> commands for disabling |
988 |
existing breakpoints and re-enabling them. See L<perldebug>. |
989 |
|
990 |
=end original |
991 |
|
992 |
デバッガに、すでに有るブレークポイントを無効にしたり、再び有効に |
993 |
したりするためのC<disable> コマンドと C<enable> コマンドが追加されました。 |
994 |
L<perldebug> を参照してください。 |
995 |
|
996 |
=head3 Breakpoints with file names |
997 |
|
998 |
(ファイル名付きのブレークポイント) |
999 |
|
1000 |
=begin original |
1001 |
|
1002 |
The debugger's "b" command for setting breakpoints now allows a line |
1003 |
number to be prefixed with a file name. See |
1004 |
L<perldebug/"b [file]:[line] [condition]">. |
1005 |
|
1006 |
=end original |
1007 |
|
1008 |
ブレークポイントを設定するためのデバッガの "b" コマンドは、ファイル名の |
1009 |
後ろに付ける行番号を受け付けるようになりました。 |
1010 |
L<perldebug/"b [file]:[line] [condition]"> を参照してください。 |
1011 |
|
1012 |
=head2 The C<CORE> Namespace |
1013 |
|
1014 |
(C<CORE> 名前空間) |
1015 |
|
1016 |
=head3 The C<CORE::> prefix |
1017 |
|
1018 |
(C<CORE::> 前置詞) |
1019 |
|
1020 |
=begin original |
1021 |
|
1022 |
The C<CORE::> prefix can now be used on keywords enabled by |
1023 |
L<feature.pm|feature>, even outside the scope of C<use feature>. |
1024 |
|
1025 |
=end original |
1026 |
|
1027 |
C<CORE::> 前置詞は、たとえ C<use feature> スコープの外側でも、 |
1028 |
L<feature.pm|feature> で有効になるキーワードで使われるようになりました。 |
1029 |
|
1030 |
=head3 Subroutines in the C<CORE> namespace |
1031 |
|
1032 |
(C<CORE> 名前空間のサブルーチン) |
1033 |
|
1034 |
=begin original |
1035 |
|
1036 |
Many Perl keywords are now available as subroutines in the CORE namespace. |
1037 |
This allows them to be aliased: |
1038 |
|
1039 |
=end original |
1040 |
|
1041 |
多くの Perl キーワードが CORE 名前空間で利用可能になりました。 |
1042 |
これにより以下のように別名にできるようになります: |
1043 |
|
1044 |
BEGIN { *entangle = \&CORE::tie } |
1045 |
entangle $variable, $package, @args; |
1046 |
|
1047 |
=begin original |
1048 |
|
1049 |
And for prototypes to be bypassed: |
1050 |
|
1051 |
=end original |
1052 |
|
1053 |
そしてプロトタイプを回避するには: |
1054 |
|
1055 |
sub mytie(\[%$*@]$@) { |
1056 |
my ($ref, $pack, @args) = @_; |
1057 |
... do something ... |
1058 |
goto &CORE::tie; |
1059 |
} |
1060 |
|
1061 |
=begin original |
1062 |
|
1063 |
Some of these cannot be called through references or via C<&foo> syntax, |
1064 |
but must be called as barewords. |
1065 |
|
1066 |
=end original |
1067 |
|
1068 |
これらの一部はリファレンスや C<&foo> 文法では呼び出すことができず、 |
1069 |
裸の単語で呼び出さなければなりません。 |
1070 |
|
1071 |
=begin original |
1072 |
|
1073 |
See L<CORE> for details. |
1074 |
|
1075 |
=end original |
1076 |
|
1077 |
詳しくは L<CORE> を参照してください。 |
1078 |
|
1079 |
=head2 Other Changes |
1080 |
|
1081 |
(その他の変更) |
1082 |
|
1083 |
=head3 Anonymous handles |
1084 |
|
1085 |
(無名ハンドル) |
1086 |
|
1087 |
=begin original |
1088 |
|
1089 |
Automatically generated file handles are now named __ANONIO__ when the |
1090 |
variable name cannot be determined, rather than $__ANONIO__. |
1091 |
|
1092 |
=end original |
1093 |
|
1094 |
変数名が決定できないときに自動的に生成されるファイルハンドルの名前は |
1095 |
$__ANONIO__ ではなく __ANONIO__ になりました。 |
1096 |
|
1097 |
=head3 Autoloaded sort Subroutines |
1098 |
|
1099 |
(ソートサブルーチンがオートロードされるように) |
1100 |
|
1101 |
=begin original |
1102 |
|
1103 |
Custom sort subroutines can now be autoloaded [perl #30661]: |
1104 |
|
1105 |
=end original |
1106 |
|
1107 |
カスタムソートサブルーチンはオートロードされるようになりました |
1108 |
[perl #30661]: |
1109 |
|
1110 |
sub AUTOLOAD { ... } |
1111 |
@sorted = sort foo @list; # uses AUTOLOAD |
1112 |
|
1113 |
=head3 C<continue> no longer requires the "switch" feature |
1114 |
|
1115 |
(C<continue> には "switch" は不要に) |
1116 |
|
1117 |
=begin original |
1118 |
|
1119 |
The C<continue> keyword has two meanings. It can introduce a C<continue> |
1120 |
block after a loop, or it can exit the current C<when> block. Up till now, |
1121 |
the latter meaning was only valid with the "switch" feature enabled, and |
1122 |
was a syntax error otherwise. Since the main purpose of feature.pm is to |
1123 |
avoid conflicts with user-defined subroutines, there is no reason for |
1124 |
C<continue> to depend on it. |
1125 |
|
1126 |
=end original |
1127 |
|
1128 |
C<continue> キーワードには二つの意味があります。 |
1129 |
ループの後に C<continue> ブロックを導入する意味と、現在の C<when> ブロックを |
1130 |
出る意味です。 |
1131 |
今まで、後者の意味は "switch" 機能が有効の場合にのみ正当で、さもなければ |
1132 |
文法エラーでした。 |
1133 |
feature.pm の主な目的はユーザー定義サブルーチンとの衝突を避けることなので、 |
1134 |
C<continue> がこれに依存している意味はありません。 |
1135 |
|
1136 |
=head3 DTrace probes for interpreter phase change |
1137 |
|
1138 |
(インタプリタフェーズ変更のための DTrace プローブ) |
1139 |
|
1140 |
=begin original |
1141 |
|
1142 |
The C<phase-change> probes will fire when the interpreter's phase |
1143 |
changes, which tracks the C<${^GLOBAL_PHASE}> variable. C<arg0> is |
1144 |
the new phase name; C<arg1> is the old one. This is useful mostly |
1145 |
for limiting your instrumentation to one or more of: compile time, |
1146 |
run time, destruct time. |
1147 |
|
1148 |
=end original |
1149 |
|
1150 |
C<phase-change> プローブは、C<${^GLOBAL_PHASE}> 変数を |
1151 |
追跡することによって、インタプリタのフェーズが変わったときに起動されます。 |
1152 |
C<arg0> は新しいフェーズ名です; C<arg1> は古いフェーズ名です。 |
1153 |
これはコンパイル時、実行時、破壊時に装備を制限するために普通は有用です。 |
1154 |
|
1155 |
=head3 C<__FILE__()> Syntax |
1156 |
|
1157 |
(C<__FILE__()> 文法) |
1158 |
|
1159 |
=begin original |
1160 |
|
1161 |
The C<__FILE__>, C<__LINE__> and C<__PACKAGE__> tokens can now be written |
1162 |
with an empty pair of parentheses after them. This makes them parse the |
1163 |
same way as C<time>, C<fork> and other built-in functions. |
1164 |
|
1165 |
=end original |
1166 |
|
1167 |
C<__FILE__>, C<__LINE__>, C<__PACKAGE__> トークンは、後ろに空のかっこの |
1168 |
組を書けるようになりました。 |
1169 |
これにより C<time>, C<fork> やその他の組み込み関数と同じ方法で |
1170 |
パースできるようになります。 |
1171 |
|
1172 |
=head3 The C<\$> prototype accepts any scalar lvalue |
1173 |
|
1174 |
=begin original |
1175 |
|
1176 |
The C<\$> and C<\[$]> subroutine prototypes now accept any scalar lvalue |
1177 |
argument. Previously they only accepted scalars beginning with C<$> and |
1178 |
hash and array elements. This change makes them consistent with the way |
1179 |
the built-in C<read> and C<recv> functions (among others) parse their |
1180 |
arguments. This means that one can override the built-in functions with |
1181 |
custom subroutines that parse their arguments the same way. |
1182 |
|
1183 |
=end original |
1184 |
|
1185 |
C<\$> と C<\[$]> のサブルーチンプロトタイプは任意のスカラ左辺値引数を |
1186 |
受け付けるようになりました。 |
1187 |
以前は C<$> で始まるスカラとハッシュおよび配列の要素のみを |
1188 |
受け付けていました。 |
1189 |
This change makes them consistent with the way |
1190 |
the built-in C<read> and C<recv> functions (among others) parse their |
1191 |
arguments. This means that one can override the built-in functions with |
1192 |
custom subroutines that parse their arguments the same way. |
1193 |
(TBT) |
1194 |
|
1195 |
=head3 C<_> in subroutine prototypes |
1196 |
|
1197 |
(サブルーチンプロトタイプの C<_>) |
1198 |
|
1199 |
=begin original |
1200 |
|
1201 |
The C<_> character in subroutine prototypes is now allowed before C<@> or |
1202 |
C<%>. |
1203 |
|
1204 |
=end original |
1205 |
|
1206 |
サブルーチンプロトタイプの C<_> 文字は C<@> や C<%> の前に |
1207 |
使えるようになりました。 |
1208 |
|
1209 |
=head1 Security |
1210 |
|
1211 |
(セキュリティ) |
1212 |
|
1213 |
=head2 Use C<is_utf8_char_buf()> and not C<is_utf8_char()> |
1214 |
|
1215 |
(C<is_utf8_char()> ではなく C<is_utf8_char_buf()> を使う) |
1216 |
|
1217 |
=begin original |
1218 |
|
1219 |
The latter function is now deprecated because its API is insufficient to |
1220 |
guarantee that it doesn't read (up to 12 bytes in the worst case) beyond |
1221 |
the end of its input string. See |
1222 |
L<is_utf8_char_buf()|/Added is_utf8_char_buf()>. |
1223 |
|
1224 |
=end original |
1225 |
|
1226 |
後者の関数は、API が入力文字列の末尾を超えて(最悪の場合最大 12 バイト) |
1227 |
読み込まないことを保証できないので非推奨になりました。 |
1228 |
L<is_utf8_char_buf()|/Added is_utf8_char_buf()> を参照してください。 |
1229 |
|
1230 |
=head2 C<File::Glob::bsd_glob()> memory error with GLOB_ALTDIRFUNC (CVE-2011-2728). |
1231 |
|
1232 |
(GLOB_ALTDIRFUNC での C<File::Glob::bsd_glob()> のメモリエラー (CVE-2011-2728)) |
1233 |
|
1234 |
=begin original |
1235 |
|
1236 |
Calling C<File::Glob::bsd_glob> with the unsupported flag |
1237 |
GLOB_ALTDIRFUNC would cause an access violation / segfault. A Perl |
1238 |
program that accepts a flags value from an external source could expose |
1239 |
itself to denial of service or arbitrary code execution attacks. There |
1240 |
are no known exploits in the wild. The problem has been corrected by |
1241 |
explicitly disabling all unsupported flags and setting unused function |
1242 |
pointers to null. Bug reported by Clément Lecigne. |
1243 |
|
1244 |
=end original |
1245 |
|
1246 |
未対応フラグ GLOB_ALTDIRFUNC 付きで C<File::Glob::bsd_glob> を呼び出すと |
1247 |
アクセス違反/セグメンテーションフォルトを引き起こすことがありました。 |
1248 |
外部ソースからフラグの値を受け付ける Perl プログラムはサービス不能攻撃や |
1249 |
任意コード実行攻撃に晒されるかもしれません。 |
1250 |
今のところ知られている攻撃はありません。 |
1251 |
この問題は、未対応フラグを明示的に無効にして、未使用関数のポインタを |
1252 |
null にすることで修正されました。 |
1253 |
バグは ClE<eacute>ment Lecigne によって報告されました。 |
1254 |
|
1255 |
=head2 Privileges are now set correctly when assigning to C<$(> |
1256 |
|
1257 |
(C<$(> への代入時に権限が適切に設定されるように) |
1258 |
|
1259 |
=begin original |
1260 |
|
1261 |
A hypothetical bug (probably non-exploitable in practice) due to the |
1262 |
incorrect setting of the effective group ID while setting C<$(> has been |
1263 |
fixed. The bug would only have affected systems that have C<setresgid()> |
1264 |
but not C<setregid()>, but no such systems are known of. |
1265 |
|
1266 |
=end original |
1267 |
|
1268 |
C<$(> の設定中の有効グループ ID の設定が正しくないことによる仮説上の |
1269 |
(おそらく実際には攻撃できない)バグが修正されました。 |
1270 |
このバグは C<setresgid()> はあるけれども C<setregid()> がないシステムにのみ |
1271 |
影響を与えますが、そのようなシステムは知られていません。 |
1272 |
|
1273 |
=head1 Deprecations |
1274 |
|
1275 |
(非推奨) |
1276 |
|
1277 |
=head2 Don't read the Unicode data base files in F<lib/unicore> |
1278 |
|
1279 |
(F<lib/unicore> にある Unicode データベースファイルは読み込まない) |
1280 |
|
1281 |
=begin original |
1282 |
|
1283 |
It is now deprecated to directly read the Unicode data base files. |
1284 |
These are stored in the F<lib/unicore> directory. Instead, you should |
1285 |
use the new functions in L<Unicode::UCD>. These provide a stable API, |
1286 |
and give complete information. |
1287 |
|
1288 |
=end original |
1289 |
|
1290 |
Unicode データベースファイルを直接読むのは非推奨になりました。 |
1291 |
これらは F<lib/unicore> ディレクトリに補完されています。 |
1292 |
代わりに、L<Unicode::UCD> の新しい関数を使うべきです。 |
1293 |
これらは安定した API を提供し、完全な情報を得られます。 |
1294 |
|
1295 |
=begin original |
1296 |
|
1297 |
Perl may at some point in the future change or remove the files. The |
1298 |
file most likely for applications to have used is |
1299 |
F<lib/unicore/ToDigit.pl>. L<Unicode::UCD/prop_invmap()> can be used to |
1300 |
get at its data instead. |
1301 |
|
1302 |
=end original |
1303 |
|
1304 |
Perl は将来のいずれかの時点でファイルを変更または削除するかもしれません。 |
1305 |
アプリケーションから一番使われていたであろうファイルは |
1306 |
F<lib/unicore/ToDigit.pl> です。 |
1307 |
代わりにこのデータを得るために L<Unicode::UCD/prop_invmap()> が使えます。 |
1308 |
|
1309 |
=head2 C<is_utf8_char()> |
1310 |
|
1311 |
=begin original |
1312 |
|
1313 |
This function is deprecated because it could read beyond the end of the |
1314 |
input string. Use the new L<is_utf8_char_buf()|/Added is_utf8_char_buf()> |
1315 |
instead. |
1316 |
|
1317 |
=end original |
1318 |
|
1319 |
この関数は、入力文字列の末尾を超えて読み込むかもしれないので、 |
1320 |
非推奨になりました。 |
1321 |
代わりに新しい L<is_utf8_char_buf()|/Added is_utf8_char_buf()> を |
1322 |
使ってください。 |
1323 |
|
1324 |
=head1 Future Deprecations |
1325 |
|
1326 |
(将来の非推奨) |
1327 |
|
1328 |
=begin original |
1329 |
|
1330 |
This section serves as a notice of features that are I<likely> to be |
1331 |
removed or L<deprecated|perlpolicy/deprecated> in the next release of |
1332 |
perl (5.18.0). If your code depends on these features, you should |
1333 |
contact the Perl 5 Porters via the L<mailing |
1334 |
list|http://lists.perl.org/list/perl5-porters.html> or L<perlbug> to |
1335 |
explain your use case and inform the deprecation process. |
1336 |
|
1337 |
=end original |
1338 |
|
1339 |
この章は、次のリリースの perl (5.18.0) で I<おそらく> 削除されるか |
1340 |
L<非推奨|perlpolicy/deprecated> になる機能を示します。 |
1341 |
あなたのコードがこれらの機能に依存しているなら、あなたのユースケースを |
1342 |
説明して非推奨プロセスに知らせるために、 |
1343 |
L<メーリングリスト|http://lists.perl.org/list/perl5-porters.html> か |
1344 |
L<perlbug> で Perl 5 Porters に知らせるべきです。 |
1345 |
|
1346 |
=head2 Core Modules |
1347 |
|
1348 |
(コアモジュール) |
1349 |
|
1350 |
=begin original |
1351 |
|
1352 |
These modules may be marked as deprecated I<from the core>. This only |
1353 |
means that they will no longer be installed by default with the core |
1354 |
distribution, but will remain available on the CPAN. |
1355 |
|
1356 |
=end original |
1357 |
|
1358 |
これらのモジュールは I<コアからは> 非推奨としてマークされました。 |
1359 |
これはコア配布でデフォルトではインストールされなくなるというだけで、 |
1360 |
CPAN からは利用可能のままです。 |
1361 |
|
1362 |
=over |
1363 |
|
1364 |
=item * |
1365 |
|
1366 |
CPANPLUS |
1367 |
|
1368 |
=item * |
1369 |
|
1370 |
Filter::Simple |
1371 |
|
1372 |
=item * |
1373 |
|
1374 |
PerlIO::mmap |
1375 |
|
1376 |
=item * |
1377 |
|
1378 |
Pod::Parser, Pod::LaTeX |
1379 |
|
1380 |
=item * |
1381 |
|
1382 |
SelfLoader |
1383 |
|
1384 |
=item * |
1385 |
|
1386 |
Text::Soundex |
1387 |
|
1388 |
=item * |
1389 |
|
1390 |
Thread.pm |
1391 |
|
1392 |
=back |
1393 |
|
1394 |
=head2 Platforms with no supporting programmers: |
1395 |
|
1396 |
(サポートするプログラマがいないプラットフォーム) |
1397 |
|
1398 |
=begin original |
1399 |
|
1400 |
These platforms will probably have their |
1401 |
special build support removed during the |
1402 |
5.17.0 development series. |
1403 |
|
1404 |
=end original |
1405 |
|
1406 |
以下のプラットフォームはおそらく 5.17.0 開発シリーズの間に独自のビルド |
1407 |
サポートが削除されます。 |
1408 |
|
1409 |
=over |
1410 |
|
1411 |
=item * |
1412 |
|
1413 |
BeOS |
1414 |
|
1415 |
=item * |
1416 |
|
1417 |
djgpp |
1418 |
|
1419 |
=item * |
1420 |
|
1421 |
dgux |
1422 |
|
1423 |
=item * |
1424 |
|
1425 |
EPOC |
1426 |
|
1427 |
=item * |
1428 |
|
1429 |
MPE/iX |
1430 |
|
1431 |
=item * |
1432 |
|
1433 |
Rhapsody |
1434 |
|
1435 |
=item * |
1436 |
|
1437 |
UTS |
1438 |
|
1439 |
=item * |
1440 |
|
1441 |
VM/ESA |
1442 |
|
1443 |
=back |
1444 |
|
1445 |
=head2 Other Future Deprecations |
1446 |
|
1447 |
(その他の将来の非推奨) |
1448 |
|
1449 |
=over |
1450 |
|
1451 |
=item * |
1452 |
|
1453 |
=begin original |
1454 |
|
1455 |
Swapping of $< and $> |
1456 |
|
1457 |
=end original |
1458 |
|
1459 |
$< と $> の交換 |
1460 |
|
1461 |
=begin original |
1462 |
|
1463 |
For more information about this future deprecation, see L<the relevant RT |
1464 |
ticket|https://rt.perl.org/rt3/Ticket/Display.html?id=96212>. |
1465 |
|
1466 |
=end original |
1467 |
|
1468 |
For more information about this future deprecation, see L<the relevant RT |
1469 |
ticket|https://rt.perl.org/rt3/Ticket/Display.html?id=96212>. |
1470 |
(TBT) |
1471 |
|
1472 |
=item * |
1473 |
|
1474 |
sfio, stdio |
1475 |
|
1476 |
=item * |
1477 |
|
1478 |
=begin original |
1479 |
|
1480 |
Unescaped literal C<< "{" >> in regular expressions. |
1481 |
|
1482 |
=end original |
1483 |
|
1484 |
正規表現中のエスケープされていないリテラルの C<< "{" >>。 |
1485 |
|
1486 |
=item Literal C<"{"> characters in regular expression patterns |
1487 |
|
1488 |
=begin original |
1489 |
|
1490 |
It is planned starting in v5.20 to require a literal C<"{"> to be |
1491 |
escaped by, for example, preceding it with a backslash. In v5.18, a |
1492 |
deprecated warning message will be emitted for all such uses. Note that |
1493 |
this only affects patterns which are to match a literal C<"{">. Other |
1494 |
uses of this character, such as part of a quantifier or sequence like in |
1495 |
the ones below are completely unaffected: |
1496 |
|
1497 |
=end original |
1498 |
|
1499 |
v5.20 から、リテラルの C<"{"> は、例えばバックスラッシュを前置することで、 |
1500 |
エスケープする必要があるようにすることが計画されています。 |
1501 |
v5.18 では、このような使用全てで警告が出力されます。 |
1502 |
これはリテラルな C<"{"> にマッチングするパターンにのみ影響を与えることに |
1503 |
注意してください。 |
1504 |
量指定子の一部や、以下のシーケンスのような、その他のこの文字の使用には |
1505 |
全く影響を与えません: |
1506 |
|
1507 |
/foo{3,5}/ |
1508 |
/\p{Alphabetic}/ |
1509 |
/\N{DIGIT ZERO} |
1510 |
|
1511 |
=begin original |
1512 |
|
1513 |
The removal of this will allow extensions to pattern syntax, and better |
1514 |
error checking of existing syntax. See L<perlre/Quantifiers> for an |
1515 |
example. |
1516 |
|
1517 |
=end original |
1518 |
|
1519 |
この除去によって、パターン文法の拡張や、既にある文法のよりよいエラーチェックが |
1520 |
可能になります。 |
1521 |
例については L<perlre/Quantifiers> を参照してください。 |
1522 |
|
1523 |
=back |
1524 |
|
1525 |
=head1 Incompatible Changes |
1526 |
|
1527 |
(互換性のない変更) |
1528 |
|
1529 |
=head2 Special blocks called in void context |
1530 |
|
1531 |
(特殊ブロックは無効コンテキストで呼び出されるように) |
1532 |
|
1533 |
=begin original |
1534 |
|
1535 |
Special blocks (C<BEGIN>, C<CHECK>, C<INIT>, C<UNITCHECK>, C<END>) are now |
1536 |
called in void context. This avoids wasteful copying of the result of the |
1537 |
last statement [perl #108794]. |
1538 |
|
1539 |
=end original |
1540 |
|
1541 |
特殊ブロック (C<BEGIN>, C<CHECK>, C<INIT>, C<UNITCHECK>, C<END>) は |
1542 |
無効コンテキストで呼び出されるようになりました。。 |
1543 |
これにより、最後の行の結果を無駄にコピーすることを防げます [perl #108794]。 |
1544 |
|
1545 |
=head2 The C<overloading> pragma and regexp objects |
1546 |
|
1547 |
(C<overloading> プラグマと正規表現オブジェクト) |
1548 |
|
1549 |
=begin original |
1550 |
|
1551 |
With C<no overloading>, regular expression objects returned by C<qr//> are |
1552 |
now stringified as "Regexp=REGEXP(0xbe600d)" instead of the regular |
1553 |
expression itself [perl #108780]. |
1554 |
|
1555 |
=end original |
1556 |
|
1557 |
C<no overloading> のとき、 C<qr//> によって返される正規表現オブジェクトは |
1558 |
正規表現自体ではなく、"Regexp=REGEXP(0xbe600d)" として |
1559 |
文字列化されるようになりました。 |
1560 |
|
1561 |
=head2 Two XS typemap Entries removed |
1562 |
|
1563 |
(二つの XS typemap エントリを削除) |
1564 |
|
1565 |
=begin original |
1566 |
|
1567 |
Two presumably unused XS typemap entries have been removed from the |
1568 |
core typemap: T_DATAUNIT and T_CALLBACK. If you are, against all odds, |
1569 |
a user of these, please see the instructions on how to regain them |
1570 |
in L<perlxstypemap>. |
1571 |
|
1572 |
=end original |
1573 |
|
1574 |
おそらく使われていない二つの XS typemap エントリ(T_DATAUNIT と T_CALLBACK)が |
1575 |
コア typemap から削除されました。 |
1576 |
もしあなたが、あらゆる予想を覆して、これらを使っているなら、 |
1577 |
これらを復活させる方法を記してある L<perlxstypemap> を参照してください。 |
1578 |
|
1579 |
=head2 Unicode 6.1 has incompatibilities with Unicode 6.0 |
1580 |
|
1581 |
(Unicode 6.1 は Unicode 6.0 と互換性がない) |
1582 |
|
1583 |
=begin original |
1584 |
|
1585 |
These are detailed in L</Supports (almost) Unicode 6.1> above. |
1586 |
You can compile this version of Perl to use Unicode 6.0. See |
1587 |
L<perlunicode/Hacking Perl to work on earlier Unicode versions (for very serious hackers only)>. |
1588 |
|
1589 |
=end original |
1590 |
|
1591 |
この詳細は上述の L</Supports (almost) Unicode 6.1> にあります。 |
1592 |
このバージョンの Perl を Unicode 6.0 を使ってコンパイルすることも出来ます。 |
1593 |
L<perlunicode/Hacking Perl to work on earlier Unicode versions (for very serious hackers only)> を |
1594 |
参照してください。 |
1595 |
|
1596 |
=head2 Borland compiler |
1597 |
|
1598 |
(Borland コンパイラ) |
1599 |
|
1600 |
=begin original |
1601 |
|
1602 |
All support for the Borland compiler has been dropped. The code had not |
1603 |
worked for a long time anyway. |
1604 |
|
1605 |
=end original |
1606 |
|
1607 |
Borland コンパイラ対応が全て削除されました。 |
1608 |
どちらにしろコードは長い間動作していませんでした。 |
1609 |
|
1610 |
=head2 Certain deprecated Unicode properties are no longer supported by default |
1611 |
|
1612 |
(いくつかの非推奨の Unicode 特性がデフォルトではサポート外に) |
1613 |
|
1614 |
=begin original |
1615 |
|
1616 |
Perl should never have exposed certain Unicode properties that are used |
1617 |
by Unicode internally and not meant to be publicly available. Use of |
1618 |
these has generated deprecated warning messages since Perl 5.12. The |
1619 |
removed properties are Other_Alphabetic, |
1620 |
Other_Default_Ignorable_Code_Point, Other_Grapheme_Extend, |
1621 |
Other_ID_Continue, Other_ID_Start, Other_Lowercase, Other_Math, and |
1622 |
Other_Uppercase. |
1623 |
|
1624 |
=end original |
1625 |
|
1626 |
Perl は、Unicode が内部で使って公開するつもりがないいくつかの Unicode 特性を |
1627 |
暴露するべきではありません。 |
1628 |
Perl 5.12 以降これらを使うと警告が出力されていました。 |
1629 |
削除された特性は、Other_Alphabetic, |
1630 |
Other_Default_Ignorable_Code_Point, Other_Grapheme_Extend, |
1631 |
Other_ID_Continue, Other_ID_Start, Other_Lowercase, Other_Math, |
1632 |
Other_Uppercase です。 |
1633 |
|
1634 |
=begin original |
1635 |
|
1636 |
Perl may be recompiled to include any or all of them; instructions are |
1637 |
given in |
1638 |
L<perluniprops/Unicode character properties that are NOT accepted by Perl>. |
1639 |
|
1640 |
=end original |
1641 |
|
1642 |
これらの一部または全部を含む形で Perl を再コンパイルすることもできます; |
1643 |
手順は |
1644 |
L<perluniprops/Unicode character properties that are NOT accepted by Perl> に |
1645 |
あります。 |
1646 |
|
1647 |
=head2 Dereferencing IO thingies as typeglobs |
1648 |
|
1649 |
(IO 系のものを型グロブとしてデリファレンス) |
1650 |
|
1651 |
=begin original |
1652 |
|
1653 |
The C<*{...}> operator, when passed a reference to an IO thingy (as in |
1654 |
C<*{*STDIN{IO}}>), creates a new typeglob containing just that IO object. |
1655 |
Previously, it would stringify as an empty string, but some operators would |
1656 |
treat it as undefined, producing an "uninitialized" warning. |
1657 |
Now it stringifies as __ANONIO__ [perl #96326]. |
1658 |
|
1659 |
=end original |
1660 |
|
1661 |
C<*{...}> 演算子は、(C<*{*STDIN{IO}}> のような) IO 系へのリファレンスを |
1662 |
渡すと、IO オブジェクト自体を含む新しい型グロブを作成します。 |
1663 |
以前は、空文字列として文字列化していましたが、一部の演算子はこれを |
1664 |
未定義として扱い、"uninitialized" 警告を出力していました。 |
1665 |
今では __ANONIO__ と文字列化されます [perl #96326]。 |
1666 |
|
1667 |
=head2 User-defined case changing operations. |
1668 |
|
1669 |
(ユーザー定義大文字変更操作) |
1670 |
|
1671 |
=begin original |
1672 |
|
1673 |
This feature was deprecated in Perl 5.14, and has now been removed. |
1674 |
The CPAN module L<Unicode::Casing> provides better functionality without |
1675 |
the drawbacks that this feature had, as are detailed in the 5.14 |
1676 |
documentation: |
1677 |
L<http://perldoc.perl.org/5.14.0/perlunicode.html#User-Defined-Case-Mappings-%28for-serious-hackers-only%29> |
1678 |
|
1679 |
=end original |
1680 |
|
1681 |
この機能は Perl 5.14 で非推奨となり、今回削除されました。 |
1682 |
CPAN モジュール L<Unicode::Casing> は、5.14 の文書に詳細に記されている通り、 |
1683 |
この機能が持っていた欠点なしに、よりよい機能を提供します: |
1684 |
L<http://perldoc.perl.org/5.14.0/perlunicode.html#User-Defined-Case-Mappings-%28for-serious-hackers-only%29> |
1685 |
|
1686 |
=head2 XSUBs are now 'static' |
1687 |
|
1688 |
(XSUB は 'static' に) |
1689 |
|
1690 |
=begin original |
1691 |
|
1692 |
XSUB C functions are now 'static', that is, they are not visible from |
1693 |
outside the compilation unit. Users can use the new C<XS_EXTERNAL(name)> |
1694 |
and C<XS_INTERNAL(name)> macros to pick the desired linking behaviour. |
1695 |
The ordinary C<XS(name)> declaration for XSUBs will continue to declare |
1696 |
non-'static' XSUBs for compatibility, but the XS compiler, |
1697 |
C<ExtUtils::ParseXS> (C<xsubpp>) will emit 'static' XSUBs by default. |
1698 |
C<ExtUtils::ParseXS>'s behaviour can be reconfigured from XS using the |
1699 |
C<EXPORT_XSUB_SYMBOLS> keyword. See L<perlxs> for details. |
1700 |
|
1701 |
=end original |
1702 |
|
1703 |
XSUB C 関数は 'static' になりました; つまり、コンパイル単位の外側からは |
1704 |
見えなくなりました。 |
1705 |
ユーザーは求めるリンクの振る舞いを得るために新しい |
1706 |
C<XS_EXTERNAL(name)> マクロと C<XS_INTERNAL(name)> マクロを使えます。 |
1707 |
XSUB の通常の C<XS(name)> 宣言は互換性のために非 'static' な XSUB を |
1708 |
宣言するままですが、XS コンパイラ C<ExtUtils::ParseXS> (C<xsubpp>) は |
1709 |
デフォルトでは 'static' XSUB を出力します。 |
1710 |
C<ExtUtils::ParseXS> の振る舞いは C<EXPORT_XSUB_SYMBOLS> キーワードを |
1711 |
使った XS によって再設定できます。 |
1712 |
詳しくは L<perlxs> を参照してください。 |
1713 |
|
1714 |
=head2 Weakening read-only references |
1715 |
|
1716 |
(読み込み専用の参照を弱くする) |
1717 |
|
1718 |
=begin original |
1719 |
|
1720 |
Weakening read-only references is no longer permitted. It should never |
1721 |
have worked anyway, and in some cases could result in crashes. |
1722 |
|
1723 |
=end original |
1724 |
|
1725 |
読み込み専用の参照を弱くすることはできなくなりました。 |
1726 |
どちらにしても正しく動作しておらず、場合によってはクラッシュしていました。 |
1727 |
|
1728 |
=head2 Tying scalars that hold typeglobs |
1729 |
|
1730 |
(型グロブを保持しているスカラの tie) |
1731 |
|
1732 |
=begin original |
1733 |
|
1734 |
Attempting to tie a scalar after a typeglob was assigned to it would |
1735 |
instead tie the handle in the typeglob's IO slot. This meant that it was |
1736 |
impossible to tie the scalar itself. Similar problems affected C<tied> and |
1737 |
C<untie>: C<tied $scalar> would return false on a tied scalar if the last |
1738 |
thing returned was a typeglob, and C<untie $scalar> on such a tied scalar |
1739 |
would do nothing. |
1740 |
|
1741 |
=end original |
1742 |
|
1743 |
型グロブを代入された後のスカラを tie しようとすると、代わりに型グロブの |
1744 |
IO スロットにあるハンドルが tie されます。 |
1745 |
これは、スカラ自身を tie することが不可能になると言うことを意味します。 |
1746 |
似たような問題は C<tied> と C<untie> に影響を与えます: C<tied $scalar> は |
1747 |
最後に返されたものが型グロブの場合は tie されたスカラに偽を返し、 |
1748 |
そのような tie されたスカラに C<untie $scalar> しても何も起きません。 |
1749 |
|
1750 |
=begin original |
1751 |
|
1752 |
We fixed this problem before Perl 5.14.0, but it caused problems with some |
1753 |
CPAN modules, so we put in a deprecation cycle instead. |
1754 |
|
1755 |
=end original |
1756 |
|
1757 |
私たちはこの問題を Perl 5.14.0 の前に修正しましたが、これは一部の |
1758 |
CPAN モジュールに問題を引き起こすので、代わりに |
1759 |
非推奨サイクルに入れることにしました。 |
1760 |
|
1761 |
=begin original |
1762 |
|
1763 |
Now the deprecation has been removed and this bug has been fixed. So |
1764 |
C<tie $scalar> will always tie the scalar, not the handle it holds. To tie |
1765 |
the handle, use C<tie *$scalar> (with an explicit asterisk). The same |
1766 |
applies to C<tied *$scalar> and C<untie *$scalar>. |
1767 |
|
1768 |
=end original |
1769 |
|
1770 |
今回非推奨は削除され、バグは修正されました。 |
1771 |
それで C<tie $scalar> は、スカラが保存しているハンドルではなく、スカラ自身を |
1772 |
tie します。 |
1773 |
ハンドルを tie するには、C<tie *$scalar> を(明示的なアスタリスク付きで) |
1774 |
使ってください。 |
1775 |
同じ内容は C<tied *$scalar> と C<untie *$scalar> にも適用されます。 |
1776 |
|
1777 |
=head2 IPC::Open3 no longer provides C<xfork()>, C<xclose_on_exec()> |
1778 |
and C<xpipe_anon()> |
1779 |
|
1780 |
(IPC::Open3 は C<xfork()>, C<xclose_on_exec()>, C<xpipe_anon()> を提供しません) |
1781 |
|
1782 |
=begin original |
1783 |
|
1784 |
All three functions were private, undocumented and unexported. They do |
1785 |
not appear to be used by any code on CPAN. Two have been inlined and one |
1786 |
deleted entirely. |
1787 |
|
1788 |
=end original |
1789 |
|
1790 |
これら三つの関数はプライベートなもので文書化されておらずエクスポートも |
1791 |
されていません。 |
1792 |
これらは CPAN のどのコードからも使われていません。 |
1793 |
二つはインライン化され、一つは完全に削除されました。 |
1794 |
|
1795 |
=head2 C<$$> no longer caches PID |
1796 |
|
1797 |
(C<$$> は PID をキャッシュしません) |
1798 |
|
1799 |
=begin original |
1800 |
|
1801 |
Previously, if one called fork(3) from C, Perl's |
1802 |
notion of C<$$> could go out of sync with what getpid() returns. By always |
1803 |
fetching the value of C<$$> via getpid(), this potential bug is eliminated. |
1804 |
Code that depends on the caching behavior will break. As described in |
1805 |
L<Core Enhancements|/C<$$> can be assigned to>, |
1806 |
C<$$> is now writable, but it will be reset during a |
1807 |
fork. |
1808 |
|
1809 |
=end original |
1810 |
|
1811 |
以前は、C から fork(3) を呼び出すと、Perl の C<$$> の概念は getpid() が |
1812 |
返すものと同期しなくなることがありました。 |
1813 |
常に getpid() 経由で C<$$> の値を取得することで、この潜在的なバグは |
1814 |
修正されました。 |
1815 |
キャッシュする振る舞いに依存しているコードは動かなくなります。 |
1816 |
L<Core Enhancements|/C<$$> can be assigned to> で記述したように、 |
1817 |
C<$$> は書き込み可能になりましたが、fork 中はリセットされます。 |
1818 |
|
1819 |
=head2 C<$$> and C<getppid()> no longer emulate POSIX semantics under LinuxThreads |
1820 |
|
1821 |
The POSIX emulation of C<$$> and C<getppid()> under the obsolete |
1822 |
LinuxThreads implementation has been removed. |
1823 |
This only impacts users of Linux 2.4 and |
1824 |
users of Debian GNU/kFreeBSD up to and including 6.0, not the vast |
1825 |
majority of Linux installations that use NPTL threads. |
1826 |
|
1827 |
This means that C<getppid()>, like C<$$>, is now always guaranteed to |
1828 |
return the OS's idea of the current state of the process, not perl's |
1829 |
cached version of it. |
1830 |
|
1831 |
See the documentation for L<$$|perlvar/$$> for details. |
1832 |
|
1833 |
=head2 C<< $< >>, C<< $> >>, C<$(> and C<$)> are no longer cached |
1834 |
|
1835 |
Similarly to the changes to C<$$> and C<getppid()>, the internal |
1836 |
caching of C<< $< >>, C<< $> >>, C<$(> and C<$)> has been removed. |
1837 |
|
1838 |
When we cached these values our idea of what they were would drift out |
1839 |
of sync with reality if someone (e.g., someone embedding perl) called |
1840 |
C<sete?[ug]id()> without updating C<PL_e?[ug]id>. Having to deal with |
1841 |
this complexity wasn't worth it given how cheap the C<gete?[ug]id()> |
1842 |
system call is. |
1843 |
|
1844 |
This change will break a handful of CPAN modules that use the XS-level |
1845 |
C<PL_uid>, C<PL_gid>, C<PL_euid> or C<PL_egid> variables. |
1846 |
|
1847 |
The fix for those breakages is to use C<PerlProc_gete?[ug]id()> to |
1848 |
retrieve them (e.g. C<PerlProc_getuid()>), and not to assign to |
1849 |
C<PL_e?[ug]id> if you change the UID/GID/EUID/EGID. There is no longer |
1850 |
any need to do so since perl will always retrieve the up-to-date |
1851 |
version of those values from the OS. |
1852 |
|
1853 |
=head2 Which Non-ASCII characters get quoted by C<quotemeta> and C<\Q> has changed |
1854 |
|
1855 |
This is unlikely to result in a real problem, as Perl does not attach |
1856 |
special meaning to any non-ASCII character, so it is currently |
1857 |
irrelevant which are quoted or not. This change fixes bug [perl #77654] and |
1858 |
bring Perl's behavior more into line with Unicode's recommendations. |
1859 |
See L<perlfunc/quotemeta>. |
1860 |
|
1861 |
=head1 Performance Enhancements |
1862 |
|
1863 |
=over |
1864 |
|
1865 |
=item * |
1866 |
|
1867 |
Improved performance for Unicode properties in regular expressions |
1868 |
|
1869 |
=for comment Can this be compacted some? -- rjbs, 2012-02-20 |
1870 |
|
1871 |
Matching a code point against a Unicode property is now done via a |
1872 |
binary search instead of linear. This means for example that the worst |
1873 |
case for a 1000 item property is 10 probes instead of 1000. This |
1874 |
inefficiency has been compensated for in the past by permanently storing |
1875 |
in a hash the results of a given probe plus the results for the adjacent |
1876 |
64 code points, under the theory that near-by code points are likely to |
1877 |
be searched for. A separate hash was used for each mention of a Unicode |
1878 |
property in each regular expression. Thus, C<qr/\p{foo}abc\p{foo}/> |
1879 |
would generate two hashes. Any probes in one instance would be unknown |
1880 |
to the other, and the hashes could expand separately to be quite large |
1881 |
if the regular expression were used on many different widely-separated |
1882 |
code points. This can lead to running out of memory in extreme cases. |
1883 |
Now, however, there is just one hash shared by all instances of a given |
1884 |
property. This means that if C<\p{foo}> is matched against "A" in one |
1885 |
regular expression in a thread, the result will be known immediately to |
1886 |
all regular expressions, and the relentless march of using up memory is |
1887 |
slowed considerably. |
1888 |
|
1889 |
=item * |
1890 |
|
1891 |
Version declarations with the C<use> keyword (e.g., C<use 5.012>) are now |
1892 |
faster, as they enable features without loading F<feature.pm>. |
1893 |
|
1894 |
=item * |
1895 |
|
1896 |
C<local $_> is faster now, as it no longer iterates through magic that it |
1897 |
is not going to copy anyway. |
1898 |
|
1899 |
=item * |
1900 |
|
1901 |
Perl 5.12.0 sped up the destruction of objects whose classes define |
1902 |
empty C<DESTROY> methods (to prevent autoloading), by simply not |
1903 |
calling such empty methods. This release takes this optimisation a |
1904 |
step further, by not calling any C<DESTROY> method that begins with a |
1905 |
C<return> statement. This can be useful for destructors that are only |
1906 |
used for debugging: |
1907 |
|
1908 |
use constant DEBUG => 1; |
1909 |
sub DESTROY { return unless DEBUG; ... } |
1910 |
|
1911 |
Constant-folding will reduce the first statement to C<return;> if DEBUG |
1912 |
is set to 0, triggering this optimisation. |
1913 |
|
1914 |
=item * |
1915 |
|
1916 |
Assigning to a variable that holds a typeglob or copy-on-write scalar |
1917 |
is now much faster. Previously the typeglob would be stringified or |
1918 |
the copy-on-write scalar would be copied before being clobbered. |
1919 |
|
1920 |
=item * |
1921 |
|
1922 |
Assignment to C<substr> in void context is now more than twice its |
1923 |
previous speed. Instead of creating and returning a special lvalue |
1924 |
scalar that is then assigned to, C<substr> modifies the original string |
1925 |
itself. |
1926 |
|
1927 |
=item * |
1928 |
|
1929 |
C<substr> no longer calculates a value to return when called in void |
1930 |
context. |
1931 |
|
1932 |
=item * |
1933 |
|
1934 |
Due to changes in L<File::Glob>, Perl's C<glob> function and its C<< |
1935 |
<...> >> equivalent are now much faster. The splitting of the pattern |
1936 |
into words has been rewritten in C, resulting in speed-ups of 20% in |
1937 |
some cases. |
1938 |
|
1939 |
This does not affect C<glob> on VMS, as it does not use File::Glob. |
1940 |
|
1941 |
=item * |
1942 |
|
1943 |
The short-circuiting operators C<&&>, C<||>, and C<//>, when chained |
1944 |
(such as C<$a || $b || $c>), are now considerably faster to short-circuit, |
1945 |
due to reduced optree traversal. |
1946 |
|
1947 |
=item * |
1948 |
|
1949 |
The implementation of C<s///r> makes one fewer copy of the scalar's value. |
1950 |
|
1951 |
=item * |
1952 |
|
1953 |
C<study> is now a no-op. |
1954 |
|
1955 |
=item * |
1956 |
|
1957 |
Recursive calls to lvalue subroutines in lvalue scalar context use less |
1958 |
memory. |
1959 |
|
1960 |
=back |
1961 |
|
1962 |
=head1 Modules and Pragmata |
1963 |
|
1964 |
XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/> |
1965 |
go here. If Module::CoreList is updated, generate an initial draft of the |
1966 |
following sections using F<Porting/corelist-perldelta.pl>, which prints stub |
1967 |
entries to STDOUT. Results can be pasted in place of the '=head2' entries |
1968 |
below. A paragraph summary for important changes should then be added by hand. |
1969 |
In an ideal world, dual-life modules would have a F<Changes> file that could be |
1970 |
cribbed. |
1971 |
|
1972 |
[ Within each section, list entries as a =item entry ] |
1973 |
|
1974 |
=head2 Deprecated Modules |
1975 |
|
1976 |
=over |
1977 |
|
1978 |
=item L<Version::Requirements> |
1979 |
|
1980 |
Version::Requirements is now DEPRECATED, use L<CPAN::Meta::Requirements>, |
1981 |
which is a drop-in replacement. It will be deleted from perl.git blead |
1982 |
in v5.17.0. |
1983 |
|
1984 |
=back |
1985 |
|
1986 |
=head2 New Modules and Pragmata |
1987 |
|
1988 |
=over 4 |
1989 |
|
1990 |
=item * |
1991 |
|
1992 |
L<arybase> -- this new module implements the C<$[> variable. |
1993 |
|
1994 |
=item * |
1995 |
|
1996 |
C<PerlIO::mmap> 0.010 has been added to the Perl core. |
1997 |
|
1998 |
The C<mmap> PerlIO layer is no longer implemented by perl itself, but has |
1999 |
been moved out into the new L<PerlIO::mmap> module. |
2000 |
|
2001 |
=back |
2002 |
|
2003 |
=head2 Updated Modules and Pragmata |
2004 |
|
2005 |
=over 4 |
2006 |
|
2007 |
=item * |
2008 |
|
2009 |
L<XXX> has been upgraded from version 0.69 to version 0.70. |
2010 |
|
2011 |
=back |
2012 |
|
2013 |
=head2 Removed Modules and Pragmata |
2014 |
|
2015 |
As promised in Perl 5.14.0's release notes, the following modules have |
2016 |
been removed from the core distribution, and if needed should be installed |
2017 |
from CPAN instead. |
2018 |
|
2019 |
=over |
2020 |
|
2021 |
=item * |
2022 |
|
2023 |
C<Devel::DProf> has been removed from the Perl core. Prior version was |
2024 |
20110228.00. |
2025 |
|
2026 |
=item * |
2027 |
|
2028 |
C<Shell> has been removed from the Perl core. Prior version was 0.72_01. |
2029 |
|
2030 |
=back |
2031 |
|
2032 |
=head1 Documentation |
2033 |
|
2034 |
=head2 New Documentation |
2035 |
|
2036 |
=head3 L<perldtrace> |
2037 |
|
2038 |
L<perldtrace> describes Perl's DTrace support, listing the provided probes |
2039 |
and gives examples of their use. |
2040 |
|
2041 |
=head3 L<perlexperiment> |
2042 |
|
2043 |
This document is intended to provide a list of experimental features in |
2044 |
Perl. It is still a work in progress. |
2045 |
|
2046 |
=head3 L<perlootut> |
2047 |
|
2048 |
This a new OO tutorial. It focuses on basic OO concepts, and then recommends |
2049 |
that readers choose an OO framework from CPAN. |
2050 |
|
2051 |
=head3 L<perlxstypemap> |
2052 |
|
2053 |
The new manual describes the XS typemapping mechanism in unprecedented |
2054 |
detail and combines new documentation with information extracted from |
2055 |
L<perlxs> and the previously unofficial list of all core typemaps. |
2056 |
|
2057 |
=head2 Changes to Existing Documentation |
2058 |
|
2059 |
=head3 L<perlapi> |
2060 |
|
2061 |
=over 4 |
2062 |
|
2063 |
=item * |
2064 |
|
2065 |
The HV API has long accepted negative lengths to indicate that the key is |
2066 |
in UTF8. Now this is documented. |
2067 |
|
2068 |
=item * |
2069 |
|
2070 |
The C<boolSV()> macro is now documented. |
2071 |
|
2072 |
=back |
2073 |
|
2074 |
=head3 L<perlfunc> |
2075 |
|
2076 |
=over 4 |
2077 |
|
2078 |
=item * |
2079 |
|
2080 |
C<dbmopen> treats a 0 mode as a special case, that prevents a nonexistent |
2081 |
file from being created. This has been the case since Perl 5.000, but was |
2082 |
never documented anywhere. Now the perlfunc entry mentions it |
2083 |
[perl #90064]. |
2084 |
|
2085 |
=item * |
2086 |
|
2087 |
As an accident of history, C<open $fh, "<:", ...> applies the default |
2088 |
layers for the platform (C<:raw> on Unix, C<:crlf> on Windows), ignoring |
2089 |
whatever is declared by L<open.pm|open>. This seems such a useful feature |
2090 |
it has been documented in L<perlfunc|perlfunc/open> and L<open>. |
2091 |
|
2092 |
=item * |
2093 |
|
2094 |
The entry for C<split> has been rewritten. It is now far clearer than |
2095 |
before. |
2096 |
|
2097 |
=back |
2098 |
|
2099 |
=head3 L<perlguts> |
2100 |
|
2101 |
=over 4 |
2102 |
|
2103 |
=item * |
2104 |
|
2105 |
A new section, L<Autoloading with XSUBs|perlguts/Autoloading with XSUBs>, |
2106 |
has been added, which explains the two APIs for accessing the name of the |
2107 |
autoloaded sub. |
2108 |
|
2109 |
=item * |
2110 |
|
2111 |
Some of the function descriptions in L<perlguts> were confusing, as it was |
2112 |
not clear whether they referred to the function above or below the |
2113 |
description. This has been clarified [perl #91790]. |
2114 |
|
2115 |
=back |
2116 |
|
2117 |
=head3 L<perlobj> |
2118 |
|
2119 |
=over 4 |
2120 |
|
2121 |
=item * |
2122 |
|
2123 |
This document has been rewritten from scratch, and its coverage of various OO |
2124 |
concepts has been expanded. |
2125 |
|
2126 |
=back |
2127 |
|
2128 |
=head3 L<perlop> |
2129 |
|
2130 |
=over 4 |
2131 |
|
2132 |
=item * |
2133 |
|
2134 |
Documentation of the smartmatch operator has been reworked and moved from |
2135 |
perlsyn to perlop where it belongs. |
2136 |
|
2137 |
It has also been corrected for the case of C<undef> on the left-hand |
2138 |
side. The list of different smart match behaviours had an item in the |
2139 |
wrong place. |
2140 |
|
2141 |
=item * |
2142 |
|
2143 |
Documentation of the ellipsis statement (C<...>) has been reworked and |
2144 |
moved from perlop to perlsyn. |
2145 |
|
2146 |
=item * |
2147 |
|
2148 |
The explanation of bitwise operators has been expanded to explain how they |
2149 |
work on Unicode strings (5.14.1). |
2150 |
|
2151 |
=item * |
2152 |
|
2153 |
More examples for C<m//g> have been added (5.14.1). |
2154 |
|
2155 |
=item * |
2156 |
|
2157 |
The C<<< <<\FOO >>> here-doc syntax has been documented (5.14.1). |
2158 |
|
2159 |
=back |
2160 |
|
2161 |
=head3 L<perlpragma> |
2162 |
|
2163 |
=over 4 |
2164 |
|
2165 |
=item * |
2166 |
|
2167 |
There is now a standard convention for naming keys in the C<%^H>, |
2168 |
documented under L<Key naming|perlpragma/Key naming>. |
2169 |
|
2170 |
=back |
2171 |
|
2172 |
=head3 L<perlsec/Laundering and Detecting Tainted Data> |
2173 |
|
2174 |
=over 4 |
2175 |
|
2176 |
=item * |
2177 |
|
2178 |
The example function for checking for taintedness contained a subtle |
2179 |
error. C<$@> needs to be localized to prevent its changing this |
2180 |
global's value outside the function. The preferred method to check for |
2181 |
this remains L<Scalar::Util/tainted>. |
2182 |
|
2183 |
=back |
2184 |
|
2185 |
=head3 L<perllol> |
2186 |
|
2187 |
=over |
2188 |
|
2189 |
=item * |
2190 |
|
2191 |
L<perllol> has been expanded with examples using the new C<push $scalar> |
2192 |
syntax introduced in Perl 5.14.0 (5.14.1). |
2193 |
|
2194 |
=back |
2195 |
|
2196 |
=head3 L<perlmod> |
2197 |
|
2198 |
=over |
2199 |
|
2200 |
=item * |
2201 |
|
2202 |
L<perlmod> now states explicitly that some types of explicit symbol table |
2203 |
manipulation are not supported. This codifies what was effectively already |
2204 |
the case [perl #78074]. |
2205 |
|
2206 |
=back |
2207 |
|
2208 |
=head3 L<perlpodstyle> |
2209 |
|
2210 |
=over 4 |
2211 |
|
2212 |
=item * |
2213 |
|
2214 |
The tips on which formatting codes to use have been corrected and greatly |
2215 |
expanded. |
2216 |
|
2217 |
=item * |
2218 |
|
2219 |
There are now a couple of example one-liners for previewing POD files after |
2220 |
they have been edited. |
2221 |
|
2222 |
=back |
2223 |
|
2224 |
=head3 L<perlre> |
2225 |
|
2226 |
=over |
2227 |
|
2228 |
=item * |
2229 |
|
2230 |
The C<(*COMMIT)> directive is now listed in the right section |
2231 |
(L<Verbs without an argument|perlre/Verbs without an argument>). |
2232 |
|
2233 |
=back |
2234 |
|
2235 |
=head3 L<perlrun> |
2236 |
|
2237 |
=over |
2238 |
|
2239 |
=item * |
2240 |
|
2241 |
L<perlrun> has undergone a significant clean-up. Most notably, the |
2242 |
B<-0x...> form of the B<-0> flag has been clarified, and the final section |
2243 |
on environment variables has been corrected and expanded (5.14.1). |
2244 |
|
2245 |
=back |
2246 |
|
2247 |
=head3 L<perlsub> |
2248 |
|
2249 |
=over |
2250 |
|
2251 |
=item * |
2252 |
|
2253 |
The ($;) prototype syntax, which has existed for rather a long time, is now |
2254 |
documented in L<perlsub>. It allows a unary function to have the same |
2255 |
precedence as a list operator. |
2256 |
|
2257 |
=back |
2258 |
|
2259 |
=head3 L<perltie> |
2260 |
|
2261 |
=over |
2262 |
|
2263 |
=item * |
2264 |
|
2265 |
The required syntax for tying handles has been documented. |
2266 |
|
2267 |
=back |
2268 |
|
2269 |
=head3 L<perlvar> |
2270 |
|
2271 |
=over |
2272 |
|
2273 |
=item * |
2274 |
|
2275 |
The documentation for L<$!|perlvar/$!> has been corrected and clarified. |
2276 |
It used to state that $! could be C<undef>, which is not the case. It was |
2277 |
also unclear as to whether system calls set C's C<errno> or Perl's C<$!> |
2278 |
[perl #91614]. |
2279 |
|
2280 |
=item * |
2281 |
|
2282 |
Documentation for L<$$|perlvar/$$> has been amended with additional |
2283 |
cautions regarding changing the process ID. |
2284 |
|
2285 |
=back |
2286 |
|
2287 |
=head3 Other Changes |
2288 |
|
2289 |
=over 4 |
2290 |
|
2291 |
=item * |
2292 |
|
2293 |
L<perlxs> was extended with documentation on inline typemaps. |
2294 |
|
2295 |
=item * |
2296 |
|
2297 |
L<perlref> has a new L<Circular References|perlref/Circular References> |
2298 |
section explaining how circularities may not be freed and how to solve that |
2299 |
with weak references. |
2300 |
|
2301 |
=item * |
2302 |
|
2303 |
Parts of L<perlapi> were clarified, and Perl equivalents of some C |
2304 |
functions have been added as an additional mode of exposition. |
2305 |
|
2306 |
=item * |
2307 |
|
2308 |
A few parts of L<perlre> and L<perlrecharclass> were clarified. |
2309 |
|
2310 |
=back |
2311 |
|
2312 |
=head2 Removed Documentation |
2313 |
|
2314 |
=head3 Old OO Documentation |
2315 |
|
2316 |
All the old OO tutorials, perltoot, perltooc, and perlboot, have been |
2317 |
removed. The perlbot (bag of object tricks) document has been removed |
2318 |
as well. |
2319 |
|
2320 |
=head3 Development Deltas |
2321 |
|
2322 |
The perldelta files for development releases are no longer packaged with |
2323 |
perl. These can still be found in the perl source code repository. |
2324 |
|
2325 |
=head1 Diagnostics |
2326 |
|
2327 |
The following additions or changes have been made to diagnostic output, |
2328 |
including warnings and fatal error messages. For the complete list of |
2329 |
diagnostic messages, see L<perldiag>. |
2330 |
|
2331 |
=head2 New Diagnostics |
2332 |
|
2333 |
=head3 New Errors |
2334 |
|
2335 |
=over 4 |
2336 |
|
2337 |
=item * |
2338 |
|
2339 |
L<Cannot set tied @DB::args|perldiag/"Cannot set tied @DB::args"> |
2340 |
|
2341 |
This error occurs when C<caller> tries to set C<@DB::args> but finds it |
2342 |
tied. Before this error was added, it used to crash instead. |
2343 |
|
2344 |
=item * |
2345 |
|
2346 |
L<Cannot tie unreifiable array|perldiag/"Cannot tie unreifiable array"> |
2347 |
|
2348 |
This error is part of a safety check that the C<tie> operator does before |
2349 |
tying a special array like C<@_>. You should never see this message. |
2350 |
|
2351 |
=item * |
2352 |
|
2353 |
L<&CORE::%s cannot be called directly|perldiag/"&CORE::%s cannot be called directly"> |
2354 |
|
2355 |
This occurs when a subroutine in the C<CORE::> namespace is called |
2356 |
with C<&foo> syntax or through a reference. Some subroutines |
2357 |
in this package cannot yet be called that way, but must be |
2358 |
called as barewords. See L</Subroutines in the C<CORE> namespace>, above. |
2359 |
|
2360 |
=item * |
2361 |
|
2362 |
L<Source filters apply only to byte streams|perldiag/"Source filters apply only to byte streams"> |
2363 |
|
2364 |
This new error occurs when you try to activate a source filter (usually by |
2365 |
loading a source filter module) within a string passed to C<eval> under the |
2366 |
C<unicode_eval> feature. |
2367 |
|
2368 |
=back |
2369 |
|
2370 |
=head3 New Warnings |
2371 |
|
2372 |
=over 4 |
2373 |
|
2374 |
=item * |
2375 |
|
2376 |
L<defined(@array) is deprecated|perldiag/"defined(@array) is deprecated"> |
2377 |
|
2378 |
The long-deprecated C<defined(@array)> now also warns for package variables. |
2379 |
Previously it only issued a warning for lexical variables. |
2380 |
|
2381 |
=item * |
2382 |
|
2383 |
L<length() used on %s|perldiag/length() used on %s> |
2384 |
|
2385 |
This new warning occurs when C<length> is used on an array or hash, instead |
2386 |
of C<scalar(@array)> or C<scalar(keys %hash)>. |
2387 |
|
2388 |
=item * |
2389 |
|
2390 |
L<lvalue attribute %s already-defined subroutine|perldiag/"lvalue attribute %s already-defined subroutine"> |
2391 |
|
2392 |
L<attributes.pm|attributes> now emits this warning when the :lvalue |
2393 |
attribute is applied to a Perl subroutine that has already been defined, as |
2394 |
doing so can have unexpected side-effects. |
2395 |
|
2396 |
=item * |
2397 |
|
2398 |
L<overload arg '%s' is invalid|perldiag/"overload arg '%s' is invalid"> |
2399 |
|
2400 |
This warning, in the "overload" category, is produced when the overload |
2401 |
pragma is given an argument it doesn't recognize, presumably a mistyped |
2402 |
operator. |
2403 |
|
2404 |
=item * |
2405 |
|
2406 |
L<$[ used in %s (did you mean $] ?)|perldiag/"$[ used in %s (did you mean $] ?)"> |
2407 |
|
2408 |
This new warning exists to catch the mistaken use of C<$[> in version |
2409 |
checks. C<$]>, not C<$[>, contains the version number. |
2410 |
|
2411 |
=item * |
2412 |
|
2413 |
L<Useless assignment to a temporary|perldiag/"Useless assignment to a temporary"> |
2414 |
|
2415 |
Assigning to a temporary scalar returned |
2416 |
from an lvalue subroutine now produces this |
2417 |
warning [perl #31946]. |
2418 |
|
2419 |
=item * |
2420 |
|
2421 |
L<Useless use of \E|perldiag/"Useless use of \E"> |
2422 |
|
2423 |
C<\E> does nothing unless preceded by C<\Q>, C<\L> or C<\U>. |
2424 |
|
2425 |
=back |
2426 |
|
2427 |
=head2 Removed Errors |
2428 |
|
2429 |
=over |
2430 |
|
2431 |
=item * |
2432 |
|
2433 |
"sort is now a reserved word" |
2434 |
|
2435 |
This error used to occur when C<sort> was called without arguments, |
2436 |
followed by C<;> or C<)>. (E.g., C<sort;> would die, but C<{sort}> was |
2437 |
OK.) This error message was added in Perl 3 to catch code like |
2438 |
C<close(sort)> which would no longer work. More than two decades later, |
2439 |
this message is no longer appropriate. Now C<sort> without arguments is |
2440 |
always allowed, and returns an empty list, as it did in those cases |
2441 |
where it was already allowed [perl #90030]. |
2442 |
|
2443 |
=back |
2444 |
|
2445 |
=head2 Changes to Existing Diagnostics |
2446 |
|
2447 |
=over 4 |
2448 |
|
2449 |
=item * |
2450 |
|
2451 |
The "Applying pattern match..." or similar warning produced when an |
2452 |
array or hash is on the left-hand side of the C<=~> operator now |
2453 |
mentions the name of the variable. |
2454 |
|
2455 |
=item * |
2456 |
|
2457 |
The "Attempt to free non-existent shared string" has had the spelling |
2458 |
of "non-existent" corrected to "nonexistent". It was already listed |
2459 |
with the correct spelling in L<perldiag>. |
2460 |
|
2461 |
=item * |
2462 |
|
2463 |
The error messages for using C<default> and C<when> outside of a |
2464 |
topicalizer have been standardised to match the messages for C<continue> |
2465 |
and loop controls. They now read 'Can't "default" outside a |
2466 |
topicalizer' and 'Can't "when" outside a topicalizer'. They both used |
2467 |
to be 'Can't use when() outside a topicalizer' [perl #91514]. |
2468 |
|
2469 |
=item * |
2470 |
|
2471 |
The message, "Code point 0x%X is not Unicode, no properties match it; |
2472 |
all inverse properties do" has been changed to "Code point 0x%X is not |
2473 |
Unicode, all \p{} matches fail; all \P{} matches succeed". |
2474 |
|
2475 |
=item * |
2476 |
|
2477 |
Redefinition warnings for constant subroutines used to be mandatory, |
2478 |
even occurring under C<no warnings>. Now they respect the L<warnings> |
2479 |
pragma. |
2480 |
|
2481 |
=item * |
2482 |
|
2483 |
The "glob failed" warning message is now suppressible via C<no warnings> |
2484 |
[perl #111656]. |
2485 |
|
2486 |
=item * |
2487 |
|
2488 |
The L<Invalid version format|perldiag/"Invalid version format (%s)"> |
2489 |
error message now says "negative version number" within the parentheses, |
2490 |
rather than "non-numeric data", for negative numbers. |
2491 |
|
2492 |
=item * |
2493 |
|
2494 |
The two warnings |
2495 |
L<Possible attempt to put comments in qw() list|perldiag/"Possible attempt to put comments in qw() list"> |
2496 |
and |
2497 |
L<Possible attempt to separate words with commas|perldiag/"Possible attempt to separate words with commas"> |
2498 |
are no longer mutually exclusive: the same C<qw> construct may produce |
2499 |
both. |
2500 |
|
2501 |
=item * |
2502 |
|
2503 |
The uninitialized warning for C<y///r> when C<$_> is implicit and |
2504 |
undefined now mentions the variable name, just like the non-/r variation |
2505 |
of the operator. |
2506 |
|
2507 |
=item * |
2508 |
|
2509 |
The 'Use of "foo" without parentheses is ambiguous' warning has been |
2510 |
extended to apply also to user-defined subroutines with a (;$) |
2511 |
prototype, and not just to built-in functions. |
2512 |
|
2513 |
=item * |
2514 |
|
2515 |
Warnings that mention the names of lexical (C<my>) variables with |
2516 |
Unicode characters in them now respect the presence or absence of the |
2517 |
C<:utf8> layer on the output handle, instead of outputting UTF8 |
2518 |
regardless. Also, the correct names are included in the strings passed |
2519 |
to C<$SIG{__WARN__}> handlers, rather than the raw UTF8 bytes. |
2520 |
|
2521 |
=back |
2522 |
|
2523 |
=head1 Utility Changes |
2524 |
|
2525 |
=head3 L<h2ph> |
2526 |
|
2527 |
=over 4 |
2528 |
|
2529 |
=item * |
2530 |
|
2531 |
L<h2ph> used to generate code of the form |
2532 |
|
2533 |
unless(defined(&FOO)) { |
2534 |
sub FOO () {42;} |
2535 |
} |
2536 |
|
2537 |
But the subroutine is a compile-time declaration, and is hence unaffected |
2538 |
by the condition. It has now been corrected to emit a string C<eval> |
2539 |
around the subroutine [perl #99368]. |
2540 |
|
2541 |
=back |
2542 |
|
2543 |
=head3 L<splain> |
2544 |
|
2545 |
=over 4 |
2546 |
|
2547 |
=item * |
2548 |
|
2549 |
F<splain> no longer emits backtraces with the first line number repeated. |
2550 |
|
2551 |
This: |
2552 |
|
2553 |
Uncaught exception from user code: |
2554 |
Cannot fwiddle the fwuddle at -e line 1. |
2555 |
at -e line 1 |
2556 |
main::baz() called at -e line 1 |
2557 |
main::bar() called at -e line 1 |
2558 |
main::foo() called at -e line 1 |
2559 |
|
2560 |
has become this: |
2561 |
|
2562 |
Uncaught exception from user code: |
2563 |
Cannot fwiddle the fwuddle at -e line 1. |
2564 |
main::baz() called at -e line 1 |
2565 |
main::bar() called at -e line 1 |
2566 |
main::foo() called at -e line 1 |
2567 |
|
2568 |
=item * |
2569 |
|
2570 |
Some error messages consist of multiple lines that are listed as separate |
2571 |
entries in L<perldiag>. splain has been taught to find the separate |
2572 |
entries in these cases, instead of simply failing to find the message. |
2573 |
|
2574 |
=back |
2575 |
|
2576 |
=head3 L<zipdetails> |
2577 |
|
2578 |
=over 4 |
2579 |
|
2580 |
=item * |
2581 |
|
2582 |
This is a new utility, included as part of an |
2583 |
L<IO::Compress::Base> upgrade. |
2584 |
|
2585 |
L<zipdetails> displays information about the internal record structure |
2586 |
of the zip file. It is not concerned with displaying any details of |
2587 |
the compressed data stored in the zip file. |
2588 |
|
2589 |
=back |
2590 |
|
2591 |
=head1 Configuration and Compilation |
2592 |
|
2593 |
=over 4 |
2594 |
|
2595 |
=item * |
2596 |
|
2597 |
The C<-Dusesitecustomize> and C<-Duserelocatableinc> options now work |
2598 |
together properly. |
2599 |
|
2600 |
=item * |
2601 |
|
2602 |
F<regexp.h> has been modified for compatibility with GCC's B<-Werror> |
2603 |
option, as used by some projects that include perl's header files (5.14.1). |
2604 |
|
2605 |
=item * |
2606 |
|
2607 |
C<USE_LOCALE{,_COLLATE,_CTYPE,_NUMERIC}> have been added the output of perl -V |
2608 |
as they have affect the behaviour of the interpreter binary (albeit only |
2609 |
in a small area). |
2610 |
|
2611 |
=item * |
2612 |
|
2613 |
The code and tests for L<IPC::Open2> have been moved from F<ext/IPC-Open2> |
2614 |
into F<ext/IPC-Open3>, as C<IPC::Open2::open2()> is implemented as a thin |
2615 |
wrapper around C<IPC::Open3::_open3()>, and hence is very tightly coupled to |
2616 |
it. |
2617 |
|
2618 |
=item * |
2619 |
|
2620 |
The magic types and magic vtables are now generated from data in a new script |
2621 |
F<regen/mg_vtable.pl>, instead of being |
2622 |
maintained by hand. As different EBCDIC |
2623 |
variants can't agree on the code point for '~', the character to code point |
2624 |
conversion is done at build time by F<generate_uudmap> to a new generated header |
2625 |
F<mg_data.h>. C<PL_vtbl_bm> and C<PL_vtbl_fm> are now defined by the |
2626 |
pre-processor as C<PL_vtbl_regexp>, instead of being distinct C variables. |
2627 |
C<PL_vtbl_sig> has been removed. |
2628 |
|
2629 |
=item * |
2630 |
|
2631 |
Building with C<-DPERL_GLOBAL_STRUCT> |
2632 |
works again. This configuration is not |
2633 |
generally used. |
2634 |
|
2635 |
=item * |
2636 |
|
2637 |
Perl configured with I<MAD> now correctly frees C<MADPROP> structures when |
2638 |
OPs are freed. C<MADPROP>s are now allocated with |
2639 |
C<PerlMemShared_malloc()> |
2640 |
|
2641 |
=back |
2642 |
|
2643 |
=head1 Testing |
2644 |
|
2645 |
XXX Any significant changes to the testing of a freshly built perl should be |
2646 |
listed here. Changes which create B<new> files in F<t/> go here as do any |
2647 |
large changes to the testing harness (e.g. when parallel testing was added). |
2648 |
Changes to existing files in F<t/> aren't worth summarising, although the bugs |
2649 |
that they represent may be covered elsewhere. |
2650 |
|
2651 |
[ List each test improvement as a =item entry ] |
2652 |
|
2653 |
=over 4 |
2654 |
|
2655 |
=item * |
2656 |
|
2657 |
XXX |
2658 |
|
2659 |
=back |
2660 |
|
2661 |
=head1 Platform Support |
2662 |
|
2663 |
XXX Any changes to platform support should be listed in the sections below. |
2664 |
|
2665 |
[ Within the sections, list each platform as a =item entry with specific |
2666 |
changes as paragraphs below it. ] |
2667 |
|
2668 |
=head2 New Platforms |
2669 |
|
2670 |
XXX List any platforms that this version of perl compiles on, that previous |
2671 |
versions did not. These will either be enabled by new files in the F<hints/> |
2672 |
directories, or new subdirectories and F<README> files at the top level of the |
2673 |
source tree. |
2674 |
|
2675 |
=over 4 |
2676 |
|
2677 |
=item XXX-some-platform |
2678 |
|
2679 |
XXX |
2680 |
|
2681 |
=back |
2682 |
|
2683 |
=head2 Discontinued Platforms |
2684 |
|
2685 |
XXX List any platforms that this version of perl no longer compiles on. |
2686 |
|
2687 |
=over 4 |
2688 |
|
2689 |
=item XXX-some-platform |
2690 |
|
2691 |
XXX |
2692 |
|
2693 |
=back |
2694 |
|
2695 |
=head2 Platform-Specific Notes |
2696 |
|
2697 |
=head3 Cygwin |
2698 |
|
2699 |
=over 4 |
2700 |
|
2701 |
=item * |
2702 |
|
2703 |
Since version 1.7, Cygwin supports native UTF-8 paths. If Perl is built |
2704 |
under that environment, directory and filenames will be UTF-8 encoded. |
2705 |
|
2706 |
Cygwin does not initialize all original Win32 environment variables. See |
2707 |
F<README.cygwin> for a discussion of the newly-added |
2708 |
C<Cygwin::sync_winenv()> function [perl #110190] and for |
2709 |
further links. |
2710 |
|
2711 |
=back |
2712 |
|
2713 |
=head3 VMS |
2714 |
|
2715 |
=over 4 |
2716 |
|
2717 |
=item * |
2718 |
|
2719 |
Remove unnecessary includes, fix miscellaneous compiler warnings and |
2720 |
close some unclosed comments on F<vms/vms.c>. |
2721 |
|
2722 |
Remove sockadapt layer from the VMS build. |
2723 |
|
2724 |
=item * |
2725 |
|
2726 |
Explicit support for VMS versions prior to v7.0 and DEC C versions |
2727 |
prior to v6.0 has been removed. |
2728 |
|
2729 |
=item * |
2730 |
|
2731 |
Since Perl 5.10.1, the home-grown C<stat> wrapper has been unable to |
2732 |
distinguish between a directory name containing an underscore and an |
2733 |
otherwise-identical filename containing a dot in the same position |
2734 |
(e.g., t/test_pl as a directory and t/test.pl as a file). This problem |
2735 |
has been corrected. |
2736 |
|
2737 |
=item * |
2738 |
|
2739 |
The build on VMS now allows names of the resulting symbols in C code for |
2740 |
Perl longer than 31 characters. Symbols like |
2741 |
C<Perl__it_was_the_best_of_times_it_was_the_worst_of_times> can now be |
2742 |
created freely without causing the VMS linker to seize up. |
2743 |
|
2744 |
=back |
2745 |
|
2746 |
=head3 GNU/Hurd |
2747 |
|
2748 |
Numerous build and test failures on GNU/Hurd have been resolved with hints |
2749 |
for building DBM modules, detection of the library search path, and enabling |
2750 |
of large file support. |
2751 |
|
2752 |
=head3 OpenVOS |
2753 |
|
2754 |
Perl is now built with dynamic linking on OpenVOS, the minimum supported |
2755 |
version of which is now Release 17.1.0. |
2756 |
|
2757 |
=head3 SunOS |
2758 |
|
2759 |
The CC workshop C++ compiler is now detected and used on systems that ship |
2760 |
without cc. |
2761 |
|
2762 |
=head1 Internal Changes |
2763 |
|
2764 |
=over 4 |
2765 |
|
2766 |
=item * |
2767 |
|
2768 |
There are now feature bundle hints in C<PL_hints> (C<$^H>) that version |
2769 |
declarations use, to avoid having to load F<feature.pm>. One setting of |
2770 |
the hint bits indicates a "custom" feature bundle, which means that the |
2771 |
entries in C<%^H> still apply. F<feature.pm> uses that. |
2772 |
|
2773 |
The C<HINT_FEATURE_MASK> macro is defined in F<perl.h> along with other |
2774 |
hints. Other macros for setting and testing features and bundles are in |
2775 |
the new F<feature.h>. C<FEATURE_IS_ENABLED> (which has moved to |
2776 |
F<feature.h>) is no longer used throughout the codebase, but more specific |
2777 |
macros, e.g., C<FEATURE_SAY_IS_ENABLED>, that are defined in F<feature.h>. |
2778 |
|
2779 |
=item * |
2780 |
|
2781 |
F<lib/feature.pm> is now a generated file, created by the new |
2782 |
F<regen/feature.pl> script, which also generates F<feature.h>. |
2783 |
|
2784 |
=item * |
2785 |
|
2786 |
Tied arrays are now always C<AvREAL>. If C<@_> or C<DB::args> is tied, it |
2787 |
is reified first, to make sure this is always the case. |
2788 |
|
2789 |
=item * |
2790 |
|
2791 |
The C<is_gv_magical_sv> function has been eliminated and merged with |
2792 |
C<gv_fetchpvn_flags>. It used to be called to determine whether a GV |
2793 |
should be autovivified in rvalue context. Now it has been replaced with a |
2794 |
new C<GV_ADDMG> flag (not part of the API). |
2795 |
|
2796 |
=item * |
2797 |
|
2798 |
Padlists are now marked C<AvREAL>; i.e., reference-counted. They have |
2799 |
always been reference-counted, but were not marked real, because F<pad.c> |
2800 |
did its own clean-up, instead of using the usual clean-up code in F<sv.c>. |
2801 |
That caused problems in thread cloning, so now the C<AvREAL> flag is on, |
2802 |
but is turned off in F<pad.c> right before the padlist is freed (after |
2803 |
F<pad.c> has done its custom freeing of the pads). |
2804 |
|
2805 |
=item * |
2806 |
|
2807 |
All the C files that make up the Perl core have been converted to UTF-8. |
2808 |
|
2809 |
=back |
2810 |
|
2811 |
=head1 Selected Bug Fixes |
2812 |
|
2813 |
=head2 Regular expressions and character classes |
2814 |
|
2815 |
XXX Is it possible to merge some of these items? |
2816 |
|
2817 |
=over 4 |
2818 |
|
2819 |
=item * |
2820 |
|
2821 |
C</[[:ascii:]]/> and C</[[:blank:]]/> now use locale rules under |
2822 |
C<use locale> when the platform supports that. Previously, they used |
2823 |
the platform's native character set. |
2824 |
|
2825 |
=item * |
2826 |
|
2827 |
C<m/[[:ascii:]]/i> and C</\p{ASCII}/i> now match identically (when not |
2828 |
under a differing locale). This fixes a regression introduced in 5.14 |
2829 |
in which the first expression could match characters outside of ASCII, |
2830 |
such as the KELVIN SIGN. |
2831 |
|
2832 |
=item * |
2833 |
|
2834 |
C</.*/g> would sometimes refuse to match at the end of a string that ends |
2835 |
with "\n". This has been fixed [perl #109206]. |
2836 |
|
2837 |
=item * |
2838 |
|
2839 |
Starting with 5.12.0, Perl used to get its internal bookkeeping muddled up |
2840 |
after assigning C<${ qr// }> to a hash element and locking it with |
2841 |
L<Hash::Util>. This could result in double frees, crashes or erratic |
2842 |
behaviour. |
2843 |
|
2844 |
=item * |
2845 |
|
2846 |
The new (in 5.14.0) regular expression modifier C</a> when repeated like |
2847 |
C</aa> forbids the characters outside the ASCII range that match |
2848 |
characters inside that range from matching under C</i>. This did not |
2849 |
work under some circumstances, all involving alternation, such as: |
2850 |
|
2851 |
"\N{KELVIN SIGN}" =~ /k|foo/iaa; |
2852 |
|
2853 |
succeeded inappropriately. This is now fixed. |
2854 |
|
2855 |
=item * |
2856 |
|
2857 |
5.14.0 introduced some memory leaks in regular expression character |
2858 |
classes such as C<[\w\s]>, which have now been fixed. (5.14.1) |
2859 |
|
2860 |
=item * |
2861 |
|
2862 |
An edge case in regular expression matching could potentially loop. |
2863 |
This happened only under C</i> in bracketed character classes that have |
2864 |
characters with multi-character folds, and the target string to match |
2865 |
against includes the first portion of the fold, followed by another |
2866 |
character that has a multi-character fold that begins with the remaining |
2867 |
portion of the fold, plus some more. |
2868 |
|
2869 |
"s\N{U+DF}" =~ /[\x{DF}foo]/i |
2870 |
|
2871 |
is one such case. C<\xDF> folds to C<"ss">. (5.14.1) |
2872 |
|
2873 |
=item * |
2874 |
|
2875 |
A few characters in regular expression pattern matches did not |
2876 |
match correctly in some circumstances, all involving C</i>. The |
2877 |
affected characters are: |
2878 |
COMBINING GREEK YPOGEGRAMMENI, |
2879 |
GREEK CAPITAL LETTER IOTA, |
2880 |
GREEK CAPITAL LETTER UPSILON, |
2881 |
GREEK PROSGEGRAMMENI, |
2882 |
GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA, |
2883 |
GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS, |
2884 |
GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA, |
2885 |
GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS, |
2886 |
LATIN SMALL LETTER LONG S, |
2887 |
LATIN SMALL LIGATURE LONG S T, |
2888 |
and |
2889 |
LATIN SMALL LIGATURE ST. |
2890 |
|
2891 |
=item * |
2892 |
|
2893 |
A memory leak regression in regular expression compilation |
2894 |
under threading has been fixed. |
2895 |
|
2896 |
=item * |
2897 |
|
2898 |
A regression introduced in 5.13.6 has |
2899 |
been fixed. This involved an inverted |
2900 |
bracketed character class in a regular expression that consisted solely |
2901 |
of a Unicode property. That property wasn't getting inverted outside the |
2902 |
Latin1 range. |
2903 |
|
2904 |
=item * |
2905 |
|
2906 |
Three problematic Unicode characters now work better in regex pattern matching under C</i> |
2907 |
|
2908 |
In the past, three Unicode characters: |
2909 |
LATIN SMALL LETTER SHARP S, |
2910 |
GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS, |
2911 |
and |
2912 |
GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS, |
2913 |
along with the sequences that they fold to |
2914 |
(including "ss" in the case of LATIN SMALL LETTER SHARP S), |
2915 |
did not properly match under C</i>. 5.14.0 fixed some of these cases, |
2916 |
but introduced others, including a panic when one of the characters or |
2917 |
sequences was used in the C<(?(DEFINE)> regular expression predicate. |
2918 |
The known bugs that were introduced in 5.14 have now been fixed; as well |
2919 |
as some other edge cases that have never worked until now. All these |
2920 |
involve using the characters and sequences outside bracketed character |
2921 |
classes under C</i>. This closes [perl #98546]. |
2922 |
|
2923 |
There remain known problems when using certain characters with |
2924 |
multi-character folds inside bracketed character classes, including such |
2925 |
constructs as C<qr/[\N{LATIN SMALL LETTER SHARP}a-z]/i>. These |
2926 |
remaining bugs are addressed in [perl #89774]. |
2927 |
|
2928 |
=item * |
2929 |
|
2930 |
RT #78266: The regex engine has been leaking memory when accessing |
2931 |
named captures that weren't matched as part of a regex ever since 5.10 |
2932 |
when they were introduced, e.g. this would consume over a hundred MB of |
2933 |
memory: |
2934 |
|
2935 |
for (1..10_000_000) { |
2936 |
if ("foo" =~ /(foo|(?<capture>bar))?/) { |
2937 |
my $capture = $+{capture} |
2938 |
} |
2939 |
} |
2940 |
system "ps -o rss $$"' |
2941 |
|
2942 |
=item * |
2943 |
|
2944 |
In 5.14, C</[[:lower:]]/i> and C</[[:upper:]]/i> no longer matched the |
2945 |
opposite case. This has been fixed [perl #101970]. |
2946 |
|
2947 |
=item * |
2948 |
|
2949 |
A regular expression match with an overloaded object on the right-hand side |
2950 |
would in some cases stringify the object too many times. |
2951 |
|
2952 |
=item * |
2953 |
|
2954 |
A regression has been fixed that was introduced in 5.14, in C</i> |
2955 |
regular expression matching, in which a match improperly fails if the |
2956 |
pattern is in UTF-8, the target string is not, and a Latin-1 character |
2957 |
precedes a character in the string that should match the pattern. |
2958 |
[perl #101710] |
2959 |
|
2960 |
=item * |
2961 |
|
2962 |
In case-insensitive regular expression pattern matching, no longer on |
2963 |
UTF-8 encoded strings does the scan for the start of match only look at |
2964 |
the first possible position. This caused matches such as |
2965 |
C<"f\x{FB00}" =~ /ff/i> to fail. |
2966 |
|
2967 |
=item * |
2968 |
|
2969 |
The regexp optimiser no longer crashes on debugging builds when merging |
2970 |
fixed-string nodes with inconvenient contents. |
2971 |
|
2972 |
=item * |
2973 |
|
2974 |
A panic involving the combination of the regular expression modifiers |
2975 |
C</aa> and the C<\b> escape sequence introduced in 5.14.0 has been |
2976 |
fixed [perl #95964]. |
2977 |
|
2978 |
=item * |
2979 |
|
2980 |
The combination of the regular expression modifiers C</aa> and the C<\b> |
2981 |
and C<\B> escape sequences did not work properly on UTF-8 encoded |
2982 |
strings. All non-ASCII characters under C</aa> should be treated as |
2983 |
non-word characters, but what was happening was that Unicode rules were |
2984 |
used to determine wordness/non-wordness for non-ASCII characters. This |
2985 |
is now fixed [perl #95968]. |
2986 |
|
2987 |
=item * |
2988 |
|
2989 |
C<< (?foo: ...) >> no longer loses passed in character set. |
2990 |
|
2991 |
=item * |
2992 |
|
2993 |
The trie optimisation used to have problems with alternations containing |
2994 |
an empty C<(?:)>, causing C<< "x" =~ /\A(?>(?:(?:)A|B|C?x))\z/ >> not to |
2995 |
match, whereas it should [perl #111842]. |
2996 |
|
2997 |
=item * |
2998 |
|
2999 |
Use of lexical (C<my>) variables in code blocks embedded in regular |
3000 |
expressions will no longer result in memory corruption or crashes. |
3001 |
|
3002 |
Nevertheless, these code blocks are still experimental, as there are still |
3003 |
problems with the wrong variables being closed over (in loops for instance) |
3004 |
and with abnormal exiting (e.g., C<die>) causing memory corruption. |
3005 |
|
3006 |
=item * |
3007 |
|
3008 |
The C<\h>, C<\H>, C<\v> and C<\V> regular expression metacharacters used to |
3009 |
cause a panic error message when attempting to match at the end of the |
3010 |
string [perl #96354]. |
3011 |
|
3012 |
=item * |
3013 |
|
3014 |
The abbreviations for four C1 control characters C<MW> C<PM>, C<RI>, and |
3015 |
C<ST> were previously unrecognized by C<\N{}>, vianame(), and |
3016 |
string_vianame(). |
3017 |
|
3018 |
=back |
3019 |
|
3020 |
=head2 Formats |
3021 |
|
3022 |
=over |
3023 |
|
3024 |
=item * |
3025 |
|
3026 |
A number of edge cases have been fixed with formats and C<formline>; |
3027 |
in particular, where the format itself is potentially variable (such as |
3028 |
with ties and overloading), and where the format and data differ in their |
3029 |
encoding. In both these cases, it used to possible for the output to be |
3030 |
corrupted [perl #91032]. |
3031 |
|
3032 |
=item * |
3033 |
|
3034 |
C<formline> no longer converts its argument into a string in-place. So |
3035 |
passing a reference to C<formline> no longer destroys the reference |
3036 |
[perl #79532]. |
3037 |
|
3038 |
=item * |
3039 |
|
3040 |
Assignment to C<$^A> (the format output accumulator) now recalculates |
3041 |
the number of lines output. |
3042 |
|
3043 |
=back |
3044 |
|
3045 |
=head2 Copy-on-write scalars |
3046 |
|
3047 |
Copy-on-write or shared hash key scalars |
3048 |
were introduced in 5.8.0, but most Perl code |
3049 |
did not encounter them (they were used mostly internally). Perl |
3050 |
5.10.0 extended them, such that assigning C<__PACKAGE__> or a |
3051 |
hash key to a scalar would make it copy-on-write. Several parts |
3052 |
of Perl were not updated to account for them, but have now been fixed. |
3053 |
|
3054 |
=over |
3055 |
|
3056 |
=item * |
3057 |
|
3058 |
C<utf8::decode> had a nasty bug that would modify copy-on-write scalars' |
3059 |
string buffers in place (i.e., skipping the copy). This could result in |
3060 |
hashes having two elements with the same key [perl #91834]. |
3061 |
|
3062 |
=item * |
3063 |
|
3064 |
Lvalue subroutines were not allowing COW scalars to be returned. This was |
3065 |
fixed for lvalue scalar context in Perl 5.12.3 and 5.14.0, but list context |
3066 |
was not fixed until this release. |
3067 |
|
3068 |
=item * |
3069 |
|
3070 |
Elements of restricted hashes (see the L<fields> pragma) containing |
3071 |
copy-on-write values couldn't be deleted, nor could such hashes be cleared |
3072 |
(C<%hash = ()>). |
3073 |
|
3074 |
=item * |
3075 |
|
3076 |
Localising a tied variable used to make it read-only if it contained a |
3077 |
copy-on-write string. |
3078 |
|
3079 |
=item * |
3080 |
|
3081 |
Assigning a copy-on-write string to a stash |
3082 |
element no longer causes a double free. Regardless of this change, the |
3083 |
results of such assignments are still undefined. |
3084 |
|
3085 |
=item * |
3086 |
|
3087 |
Assigning a copy-on-write string to a tied variable no longer stops that |
3088 |
variable from being tied if it happens to be a PVMG or PVLV internally. |
3089 |
|
3090 |
=item * |
3091 |
|
3092 |
Doing a substitution on a tied variable returning a copy-on-write |
3093 |
scalar used to cause an assertion failure or an "Attempt to free |
3094 |
nonexistent shared string" warning. |
3095 |
|
3096 |
=item * |
3097 |
|
3098 |
This one is a regression from 5.12: In 5.14.0, the bitwise assignment |
3099 |
operators C<|=>, C<^=> and C<&=> started leaving the left-hand side |
3100 |
undefined if it happened to be a copy-on-write string [perl #108480]. |
3101 |
|
3102 |
=item * |
3103 |
|
3104 |
L<Storable>, L<Devel::Peek> and L<PerlIO::scalar> had similar problems. |
3105 |
See L</Updated Modules and Pragmata>, above. |
3106 |
|
3107 |
XXX That section is empty. |
3108 |
|
3109 |
=back |
3110 |
|
3111 |
=head2 Lvalue subroutines |
3112 |
|
3113 |
=over |
3114 |
|
3115 |
=item * |
3116 |
|
3117 |
Explicit return now returns the actual argument passed to return, instead |
3118 |
of copying it [perl #72724, #72706]. |
3119 |
|
3120 |
=item * |
3121 |
|
3122 |
Lvalue subroutines used to enforce lvalue syntax (i.e., whatever can go on |
3123 |
the left-hand side of C<=>) for the last statement and the arguments to |
3124 |
return. Since lvalue subroutines are not always called in lvalue context, |
3125 |
this restriction has been lifted. |
3126 |
|
3127 |
=item * |
3128 |
|
3129 |
Lvalue subroutines are less restrictive as to what values can be returned. |
3130 |
It used to croak on values returned by C<shift> and C<delete> and from |
3131 |
other subroutines, but no longer does so [perl #71172]. |
3132 |
|
3133 |
=item * |
3134 |
|
3135 |
Empty lvalue subroutines (C<sub :lvalue {}>) used to return C<@_> in list |
3136 |
context. In fact, all subroutines used to, but regular subs were fixed in |
3137 |
Perl 5.8.2. Now lvalue subroutines have been likewise fixed. |
3138 |
|
3139 |
=item * |
3140 |
|
3141 |
Autovivification now works on values returned from lvalue subroutines |
3142 |
[perl #7946], as does returning C<keys> in lvalue context. |
3143 |
|
3144 |
=item * |
3145 |
|
3146 |
Lvalue subroutines used to copy their return values in rvalue context. Not |
3147 |
only was this a waste of CPU cycles, but it also caused bugs. A C<($)> |
3148 |
prototype would cause an lvalue sub to copy its return value [perl #51408], |
3149 |
and C<while(lvalue_sub() =~ m/.../g) { ... }> would loop endlessly |
3150 |
[perl #78680]. |
3151 |
|
3152 |
=item * |
3153 |
|
3154 |
When called in potential lvalue context |
3155 |
(e.g., subroutine arguments or a list |
3156 |
passed to C<for>), lvalue subroutines used to copy |
3157 |
any read-only value that was returned. E.g., C< sub :lvalue { $] } > |
3158 |
would not return C<$]>, but a copy of it. |
3159 |
|
3160 |
=item * |
3161 |
|
3162 |
When called in potential lvalue context, an lvalue subroutine returning |
3163 |
arrays or hashes used to bind the arrays or hashes to scalar variables, |
3164 |
resulting in bugs. This was fixed in 5.14.0 if an array were the first |
3165 |
thing returned from the subroutine (but not for C<$scalar, @array> or |
3166 |
hashes being returned). Now a more general fix has been applied |
3167 |
[perl #23790]. |
3168 |
|
3169 |
=item * |
3170 |
|
3171 |
Method calls whose arguments were all surrounded with C<my()> or C<our()> |
3172 |
(as in C<< $object->method(my($a,$b)) >>) used to force lvalue context on |
3173 |
the subroutine. This would prevent lvalue methods from returning certain |
3174 |
values. |
3175 |
|
3176 |
=item * |
3177 |
|
3178 |
Lvalue sub calls that are not determined to be such at compile time |
3179 |
(C<&$name> or &{"name"}) are no longer exempt from strict refs if they |
3180 |
occur in the last statement of an lvalue subroutine [perl #102486]. |
3181 |
|
3182 |
=item * |
3183 |
|
3184 |
Sub calls whose subs are not visible at compile time, if |
3185 |
they occurred in the last statement of an lvalue subroutine, |
3186 |
would reject non-lvalue subroutines and die with "Can't modify non-lvalue |
3187 |
subroutine call" [perl #102486]. |
3188 |
|
3189 |
Non-lvalue sub calls whose subs I<are> visible at compile time exhibited |
3190 |
the opposite bug. If the call occurred in the last statement of an lvalue |
3191 |
subroutine, there would be no error when the lvalue sub was called in |
3192 |
lvalue context. Perl would blindly assign to the temporary value returned |
3193 |
by the non-lvalue subroutine. |
3194 |
|
3195 |
=item * |
3196 |
|
3197 |
C<AUTOLOAD> routines used to take precedence over the actual sub being |
3198 |
called (i.e., when autoloading wasn't needed), for sub calls in lvalue or |
3199 |
potential lvalue context, if the subroutine was not visible at compile |
3200 |
time. |
3201 |
|
3202 |
=item * |
3203 |
|
3204 |
Applying the C<:lvalue> attribute to an XSUB or to an aliased subroutine |
3205 |
stub with C<< sub foo :lvalue; >> syntax stopped working in Perl 5.12. |
3206 |
This has been fixed. |
3207 |
|
3208 |
=item * |
3209 |
|
3210 |
Applying the :lvalue attribute to subroutine that is already defined does |
3211 |
not work properly, as the attribute changes the way the sub is compiled. |
3212 |
Hence, Perl 5.12 began warning when an attempt is made to apply the |
3213 |
attribute to an already defined sub. In such cases, the attribute is |
3214 |
discarded. |
3215 |
|
3216 |
But the change in 5.12 missed the case where custom attributes are also |
3217 |
present: that case still silently and ineffectively applied the attribute. |
3218 |
That omission has now been corrected. C<sub foo :lvalue :Whatever> (when |
3219 |
C<foo> is already defined) now warns about the :lvalue attribute, and does |
3220 |
not apply it. |
3221 |
|
3222 |
=item * |
3223 |
|
3224 |
A bug affecting lvalue context propagation through nested lvalue subroutine |
3225 |
calls has been fixed. Previously, returning a value in nested rvalue |
3226 |
context would be treated as lvalue context by the inner subroutine call, |
3227 |
resulting in some values (such as read-only values) being rejected. |
3228 |
|
3229 |
=back |
3230 |
|
3231 |
=head2 Compile-time hints |
3232 |
|
3233 |
=over |
3234 |
|
3235 |
=item * |
3236 |
|
3237 |
Tying C<%^H> no longer causes perl to crash or ignore the contents of |
3238 |
C<%^H> when entering a compilation scope [perl #106282]. |
3239 |
|
3240 |
=item * |
3241 |
|
3242 |
C<eval $string> and C<require> used not to |
3243 |
localise C<%^H> during compilation if it |
3244 |
was empty at the time the C<eval> call itself was compiled. This could |
3245 |
lead to scary side effects, like C<use re "/m"> enabling other flags that |
3246 |
the surrounding code was trying to enable for its caller [perl #68750]. |
3247 |
|
3248 |
=item * |
3249 |
|
3250 |
C<eval $string> and C<require> no longer localise hints (C<$^H> and C<%^H>) |
3251 |
at run time, but only during compilation of the $string or required file. |
3252 |
This makes C<BEGIN { $^H{foo}=7 }> equivalent to |
3253 |
C<BEGIN { eval '$^H{foo}=7' }> [perl #70151]. |
3254 |
|
3255 |
=item * |
3256 |
|
3257 |
Creating a BEGIN block from XS code (via C<newXS> or C<newATTRSUB>) would, |
3258 |
on completion, make the hints of the current compiling code the current |
3259 |
hints. This could cause warnings to occur in a non-warning scope. |
3260 |
|
3261 |
=back |
3262 |
|
3263 |
=head2 Fixes related to hashes and arrays |
3264 |
|
3265 |
=over |
3266 |
|
3267 |
=item * |
3268 |
|
3269 |
A bug has been fixed that would cause a "Use of freed value in iteration" |
3270 |
error if the next two hash elements that would be iterated over are |
3271 |
deleted [perl #85026]. (5.14.1) |
3272 |
|
3273 |
=item * |
3274 |
|
3275 |
Deleting the current hash iterator (the hash element that would be returend |
3276 |
by the next call to C<each>) in void context used not to free it |
3277 |
[perl #85026]. |
3278 |
|
3279 |
=item * |
3280 |
|
3281 |
Deletion of methods via C<delete $Class::{method}> syntax used to update |
3282 |
method caches if called in void context, but not scalar or list context. |
3283 |
|
3284 |
=item * |
3285 |
|
3286 |
When hash elements are deleted in void context, the internal hash entry is |
3287 |
now freed before the value is freed, to prevent destructors called by that |
3288 |
latter freeing from seeing the hash in an inconsistent state. It was |
3289 |
possible to cause double-frees if the destructor freed the hash itself |
3290 |
[perl #100340]. |
3291 |
|
3292 |
=item * |
3293 |
|
3294 |
A C<keys> optimisation in Perl 5.12.0 to make it faster on empty hashes |
3295 |
caused C<each> not to reset the iterator if called after the last element |
3296 |
was deleted. |
3297 |
|
3298 |
=item * |
3299 |
|
3300 |
Freeing deeply nested hashes no longer crashes [perl #44225]. |
3301 |
|
3302 |
=item * |
3303 |
|
3304 |
It is possible from XS code to create hashes with elements that have no |
3305 |
values. The hash element and slice operators used to crash |
3306 |
when handling these in lvalue context. They now |
3307 |
produce a "Modification of non-creatable hash value attempted" error |
3308 |
message. |
3309 |
|
3310 |
=item * |
3311 |
|
3312 |
If list assignment to a hash or array triggered destructors that freed the |
3313 |
hash or array itself, a crash would ensue. This is no longer the case |
3314 |
[perl #107440]. |
3315 |
|
3316 |
=item * |
3317 |
|
3318 |
It used to be possible to free the typeglob of a localised array or hash |
3319 |
(e.g., C<local @{"x"}; delete $::{x}>), resulting in a crash on scope exit. |
3320 |
|
3321 |
=item * |
3322 |
|
3323 |
Some core bugs affecting L<Hash::Util> have been fixed: locking a hash |
3324 |
element that is a glob copy no longer causes subsequent assignment to it to |
3325 |
corrupt the glob, and unlocking a hash element that holds a copy-on-write |
3326 |
scalar no longer causes modifications to that scalar to modify other |
3327 |
scalars that were sharing the same string buffer. |
3328 |
|
3329 |
=back |
3330 |
|
3331 |
=head2 Weak references |
3332 |
|
3333 |
=over |
3334 |
|
3335 |
=item * |
3336 |
|
3337 |
Weakening the first argument to an automatically-invoked C<DESTROY> method |
3338 |
could result in erroneous "DESTROY created new reference" errors or |
3339 |
crashes. Now it is an error to weaken a read-only reference. |
3340 |
|
3341 |
=item * |
3342 |
|
3343 |
Weak references to lexical hashes going out of scope were not going stale |
3344 |
(becoming undefined), but continued to point to the hash. |
3345 |
|
3346 |
=item * |
3347 |
|
3348 |
Weak references to lexical variables going out of scope are now broken |
3349 |
before any magical methods (e.g., DESTROY on a tie object) are called. |
3350 |
This prevents such methods from modifying the variable that will be seen |
3351 |
the next time the scope is entered. |
3352 |
|
3353 |
=item * |
3354 |
|
3355 |
Creating a weak reference to an @ISA array or accessing the array index |
3356 |
(C<$#ISA>) could result in confused internal bookkeeping for elements |
3357 |
subsequently added to the @ISA array. For instance, creating a weak |
3358 |
reference to the element itself could push that weak reference on to @ISA; |
3359 |
and elements added after use of C<$#ISA> would be ignored by method lookup |
3360 |
[perl #85670]. |
3361 |
|
3362 |
=back |
3363 |
|
3364 |
=head2 Support for embedded nulls |
3365 |
|
3366 |
Some parts of Perl did not work correctly with nulls (C<chr 0>) embedded in |
3367 |
strings. That meant that, for instance, C<< $m = "a\0b"; foo->$m >> would |
3368 |
call the "a" method, instead of the actual method name contained in $m. |
3369 |
These parts of perl have been fixed to support nulls: |
3370 |
|
3371 |
=over |
3372 |
|
3373 |
=item * |
3374 |
|
3375 |
Method names |
3376 |
|
3377 |
=item * |
3378 |
|
3379 |
Typeglob names (including filehandle and subroutine names) |
3380 |
|
3381 |
=item * |
3382 |
|
3383 |
Package names, including the return value of C<ref()> |
3384 |
|
3385 |
=item * |
3386 |
|
3387 |
Typeglob elements (C<*foo{"THING\0stuff"}>) |
3388 |
|
3389 |
=item * |
3390 |
|
3391 |
Signal names |
3392 |
|
3393 |
=item * |
3394 |
|
3395 |
Various warnings and error messages that mention variable names or values, |
3396 |
methods, etc. |
3397 |
|
3398 |
=back |
3399 |
|
3400 |
One side effect of these changes is that blessing into "\0" no longer |
3401 |
causes C<ref()> to return false. |
3402 |
|
3403 |
=head2 Filetests and C<stat> |
3404 |
|
3405 |
The term "filetests" refers to the operators that consist of a hyphen |
3406 |
followed by a single letter: C<-r>, C<-x>, C<-M>, etc. The term "stacked" |
3407 |
when applied to filetests means followed by another filetest operator |
3408 |
sharing the same operand, as in C<-r -x -w $fooo>. |
3409 |
|
3410 |
=over |
3411 |
|
3412 |
=item * |
3413 |
|
3414 |
C<stat> produces more consistent warnings. It no longer warns for "_" |
3415 |
[perl #71002] and no longer skips the warning at times for other unopened |
3416 |
handles. It no longer warns about an unopened handle when the operating |
3417 |
system's C<fstat> function fails. |
3418 |
|
3419 |
=item * |
3420 |
|
3421 |
C<stat> would sometimes return negative numbers for large inode numbers, |
3422 |
because it was using the wrong internal C type. [perl #84590] |
3423 |
|
3424 |
=item * |
3425 |
|
3426 |
C<lstat> is documented to fall back to C<stat> (with a warning) when given |
3427 |
a filehandle. When passed an IO reference, it was actually doing the |
3428 |
equivalent of S<C<stat _>> and ignoring the handle. |
3429 |
|
3430 |
=item * |
3431 |
|
3432 |
C<-T _> with no preceding C<stat> used to produce a |
3433 |
confusing "uninitialized" warning, even though there |
3434 |
is no visible uninitialized value to speak of. |
3435 |
|
3436 |
=item * |
3437 |
|
3438 |
C<-T>, C<-B>, C<-l> and C<-t> now work |
3439 |
when stacked with other filetest operators |
3440 |
[perl #77388]. |
3441 |
|
3442 |
=item * |
3443 |
|
3444 |
In 5.14.0, filetest ops (C<-r>, C<-x>, etc.) started calling FETCH on a |
3445 |
tied argument belonging to the previous argument to a list operator, if |
3446 |
called with a bareword argument or no argument at all. This has been |
3447 |
fixed, so C<push @foo, $tied, -r> no longer calls FETCH on C<$tied>. |
3448 |
|
3449 |
=item * |
3450 |
|
3451 |
In Perl 5.6, C<-l> followed by anything other than a bareword would treat |
3452 |
its argument as a file name. That was changed in 5.8 for glob references |
3453 |
(C<\*foo>), but not for globs themselves (C<*foo>). C<-l> started |
3454 |
returning C<undef> for glob references without setting the last |
3455 |
stat buffer that the "_" handle uses, but only if warnings |
3456 |
were turned on. With warnings off, it was the same as 5.6. |
3457 |
In other words, it was simply buggy and inconsistent. Now the 5.6 |
3458 |
behaviour has been restored. |
3459 |
|
3460 |
=item * |
3461 |
|
3462 |
C<-l> followed by a bareword no longer "eats" the previous argument to |
3463 |
the list operator in whose argument list it resides. Hence, |
3464 |
C<print "bar", -l foo> now actually prints "bar", because C<-l> |
3465 |
on longer eats it. |
3466 |
|
3467 |
=item * |
3468 |
|
3469 |
Perl keeps several internal variables to keep track of the last stat |
3470 |
buffer, from which file(handle) it originated, what type it was, and |
3471 |
whether the last stat succeeded. |
3472 |
|
3473 |
There were various cases where these could get out of synch, resulting in |
3474 |
inconsistent or erratic behaviour in edge cases (every mention of C<-T> |
3475 |
applies to C<-B> as well): |
3476 |
|
3477 |
=over |
3478 |
|
3479 |
=item * |
3480 |
|
3481 |
C<-T I<HANDLE>>, even though it does a C<stat>, was not resetting the last |
3482 |
stat type, so an C<lstat _> following it would merrily return the wrong |
3483 |
results. Also, it was not setting the success status. |
3484 |
|
3485 |
=item * |
3486 |
|
3487 |
Freeing the handle last used by C<stat> or a filetest could result in |
3488 |
S<C<-T _>> using an unrelated handle. |
3489 |
|
3490 |
=item * |
3491 |
|
3492 |
C<stat> with an IO reference would not reset the stat type or record the |
3493 |
filehandle for S<C<-T _>> to use. |
3494 |
|
3495 |
=item * |
3496 |
|
3497 |
Fatal warnings could cause the stat buffer not to be reset |
3498 |
for a filetest operator on an unopened filehandle or C<-l> on any handle. |
3499 |
Fatal warnings also stopped C<-T> from setting C<$!>. |
3500 |
|
3501 |
=item * |
3502 |
|
3503 |
When the last stat was on an unreadable file, C<-T _> is supposed to |
3504 |
return C<undef>, leaving the last stat buffer unchanged. But it was |
3505 |
setting the stat type, causing C<lstat _> to stop working. |
3506 |
|
3507 |
=item * |
3508 |
|
3509 |
C<-T I<FILENAME>> was not resetting the internal stat buffers for |
3510 |
unreadable files. |
3511 |
|
3512 |
=back |
3513 |
|
3514 |
These have all been fixed. |
3515 |
|
3516 |
=back |
3517 |
|
3518 |
=head2 Version objects and vstrings |
3519 |
|
3520 |
=over |
3521 |
|
3522 |
=item * |
3523 |
|
3524 |
The bitwise complement operator (and possibly other operators, too) when |
3525 |
passed a vstring would leave vstring magic attached to the return value, |
3526 |
even though the string had changed. This meant that |
3527 |
C<< version->new(~v1.2.3) >> would create a version looking like "v1.2.3" |
3528 |
even though the string passed to C<< version->new >> was actually |
3529 |
"\376\375\374". This also caused L<B::Deparse> to deparse C<~v1.2.3> |
3530 |
incorrectly, without the C<~> [perl #29070]. |
3531 |
|
3532 |
=item * |
3533 |
|
3534 |
Assigning a vstring to a magic (e.g., tied, C<$!>) variable and then |
3535 |
assigning something else used to blow away all the magic. This meant that |
3536 |
tied variables would come undone, C<$!> would stop getting updated on |
3537 |
failed system calls, C<$|> would stop setting autoflush, and other |
3538 |
mischief would take place. This has been fixed. |
3539 |
|
3540 |
=item * |
3541 |
|
3542 |
C<< version->new("version") >> and C<printf "%vd", "version"> no longer |
3543 |
crash [perl #102586]. |
3544 |
|
3545 |
=item * |
3546 |
|
3547 |
Version comparisons, such as those that happen implicitly with C<use |
3548 |
v5.43>, no longer cause locale settings to change [perl #105784]. |
3549 |
|
3550 |
=item * |
3551 |
|
3552 |
Version objects no longer cause memory leaks in boolean context |
3553 |
[perl #109762]. |
3554 |
|
3555 |
=back |
3556 |
|
3557 |
=head2 Tied variables |
3558 |
|
3559 |
=over |
3560 |
|
3561 |
=item * |
3562 |
|
3563 |
Various cases in which FETCH was being ignored or called too many times |
3564 |
have been fixed: |
3565 |
|
3566 |
=over |
3567 |
|
3568 |
=item * |
3569 |
|
3570 |
C<PerlIO::get_layers> [perl #97956] |
3571 |
|
3572 |
=item * |
3573 |
|
3574 |
C<$tied =~ y/a/b/>, C<chop $tied> and C<chomp $tied> when $tied holds a |
3575 |
reference. |
3576 |
|
3577 |
=item * |
3578 |
|
3579 |
Four-argument C<select> |
3580 |
|
3581 |
=item * |
3582 |
|
3583 |
A tied buffer passed to C<sysread> |
3584 |
|
3585 |
=item * |
3586 |
|
3587 |
C<< $tied .= <> >> |
3588 |
|
3589 |
=item * |
3590 |
|
3591 |
Three-argument C<open>, the third being a tied file handle |
3592 |
(as in C<< open $fh, ">&", $tied >>) |
3593 |
|
3594 |
=item * |
3595 |
|
3596 |
C<sort> with a reference to a tied glob for the comparison routine. |
3597 |
|
3598 |
=item * |
3599 |
|
3600 |
C<..> and C<...> in list context [perl #53554]. |
3601 |
|
3602 |
=item * |
3603 |
|
3604 |
C<${$tied}>, C<@{$tied}>, C<%{$tied}> and C<*{$tied}> where the tied |
3605 |
variable returns a string (C<&{}> was unaffected) |
3606 |
|
3607 |
=item * |
3608 |
|
3609 |
C<defined ${ $tied_variable }> |
3610 |
|
3611 |
=item * |
3612 |
|
3613 |
Various functions that take a filehandle argument in rvalue context |
3614 |
(C<close>, C<readline>, etc.) [perl #97482] |
3615 |
|
3616 |
=item * |
3617 |
|
3618 |
Some cases of dereferencing a complex expression, such as |
3619 |
C<${ (), $tied } = 1>, used to call C<FETCH> multiple times, but now call |
3620 |
it once. |
3621 |
|
3622 |
=item * |
3623 |
|
3624 |
C<$tied-E<gt>method> where $tied returns a package name--even resulting in |
3625 |
a failure to call the method, due to memory corruption |
3626 |
|
3627 |
=item * |
3628 |
|
3629 |
Assignments like C<*$tied = \&{"..."}> and C<*glob = $tied> |
3630 |
|
3631 |
=item * |
3632 |
|
3633 |
C<chdir>, C<chmod>, C<chown>, C<utime>, C<truncate>, C<stat>, C<lstat> and |
3634 |
the filetest ops (C<-r>, C<-x>, etc.) |
3635 |
|
3636 |
=back |
3637 |
|
3638 |
=item * |
3639 |
|
3640 |
C<caller> sets C<@DB::args> to the subroutine arguments when called from |
3641 |
the DB package. It used to crash when doing so if C<@DB::args> happened to |
3642 |
be tied. Now it croaks instead. |
3643 |
|
3644 |
=item * |
3645 |
|
3646 |
Tying an element of %ENV or C<%^H> and then deleting that element would |
3647 |
result in a call to the tie object's DELETE method, even though tying the |
3648 |
element itself is supposed to be equivalent to tying a scalar (the element |
3649 |
is, of course, a scalar) [perl #67490]. |
3650 |
|
3651 |
=item * |
3652 |
|
3653 |
When Perl autovivifies an element of a tied array or hash (which entails |
3654 |
calling STORE with a new reference), it now calls FETCH immediately after |
3655 |
the STORE, instead of assuming that FETCH would have returned the same |
3656 |
reference. This can make it easier to implement tied objects [perl #35865, #43011]. |
3657 |
|
3658 |
=item * |
3659 |
|
3660 |
Four-argument C<select> no longer produces its "Non-string passed as |
3661 |
bitmask" warning on tied or tainted variables that are strings. |
3662 |
|
3663 |
=item * |
3664 |
|
3665 |
Localising a tied scalar that returns a typeglob no longer stops it from |
3666 |
being tied till the end of the scope. |
3667 |
|
3668 |
=item * |
3669 |
|
3670 |
Attempting to C<goto> out of a tied handle method used to cause memory |
3671 |
corruption or crashes. Now it produces an error message instead |
3672 |
[perl #8611]. |
3673 |
|
3674 |
=item * |
3675 |
|
3676 |
A bug has been fixed that occurs when a tied variable is used as a |
3677 |
subroutine reference: if the last thing assigned to or returned from the |
3678 |
variable was a reference or typeglob, the C<\&$tied> could either crash or |
3679 |
return the wrong subroutine. The reference case is a regression introduced |
3680 |
in Perl 5.10.0. For typeglobs, it has probably never worked till now. |
3681 |
|
3682 |
=back |
3683 |
|
3684 |
=head2 "Uninitialized" warnings |
3685 |
|
3686 |
=over |
3687 |
|
3688 |
=item * |
3689 |
|
3690 |
Various functions that take a filehandle argument in rvalue context |
3691 |
(C<close>, C<readline>, etc.) used to warn twice for an undefined handle |
3692 |
[perl #97482]. |
3693 |
|
3694 |
=item * |
3695 |
|
3696 |
C<dbmopen> now only warns once, rather than three times, if the mode |
3697 |
argument is C<undef> [perl #90064]. |
3698 |
|
3699 |
=item * |
3700 |
|
3701 |
The C<+=> operator does not usually warn when the left-hand side is |
3702 |
C<undef>, but it was doing so for tied variables. This has been fixed |
3703 |
[perl #44895]. |
3704 |
|
3705 |
=item * |
3706 |
|
3707 |
A bug fix in Perl 5.14 introduced a new bug, causing "uninitialized" |
3708 |
warnings to report the wrong variable if the operator in question had |
3709 |
two operands and one was C<%{...}> or C<@{...}>. This has been fixed |
3710 |
[perl #103766]. |
3711 |
|
3712 |
=item * |
3713 |
|
3714 |
C<..> and C<...> in list context now mention the name of the variable in |
3715 |
"uninitialized" warnings for string (as opposed to numeric) ranges. |
3716 |
|
3717 |
=back |
3718 |
|
3719 |
=head2 Last-accessed filehandle |
3720 |
|
3721 |
Perl has an internal variable that stores the last filehandle to be |
3722 |
accessed. It is used by C<$.> and by C<tell> and C<eof> without |
3723 |
arguments. |
3724 |
|
3725 |
=over |
3726 |
|
3727 |
=item * |
3728 |
|
3729 |
It used to be possible to set this internal variable to a glob copy and |
3730 |
then modify that glob copy to be something other than a glob, and still |
3731 |
have the last-accessed filehandle associated with the variable after |
3732 |
assigning a glob to it again: |
3733 |
|
3734 |
my $foo = *STDOUT; # $foo is a glob copy |
3735 |
<$foo>; # $foo is now the last-accessed handle |
3736 |
$foo = 3; # no longer a glob |
3737 |
$foo = *STDERR; # still the last-accessed handle |
3738 |
|
3739 |
Now the C<$foo = 3> assignment unsets that internal variable, so there |
3740 |
is no last-accessed filehandle, just as if C<< <$foo> >> had never |
3741 |
happened. |
3742 |
|
3743 |
This also prevents some unrelated handle from becoming the last-accessed |
3744 |
handle if $foo falls out of scope and the same internal SV gets used for |
3745 |
another handle [perl #97988]. |
3746 |
|
3747 |
=item * |
3748 |
|
3749 |
A regression in 5.14 caused these statements not to set that internal |
3750 |
variable: |
3751 |
|
3752 |
my $fh = *STDOUT; |
3753 |
tell $fh; |
3754 |
eof $fh; |
3755 |
seek $fh, 0,0; |
3756 |
tell *$fh; |
3757 |
eof *$fh; |
3758 |
seek *$fh, 0,0; |
3759 |
readline *$fh; |
3760 |
|
3761 |
This is now fixed, but C<tell *{ *$fh }> still has the problem, and it |
3762 |
is not clear how to fix it [perl #106536]. |
3763 |
|
3764 |
=back |
3765 |
|
3766 |
=head2 Redefinition warnings |
3767 |
|
3768 |
=over |
3769 |
|
3770 |
=item * |
3771 |
|
3772 |
Subroutines from the C<autouse> namespace are once more exempt from |
3773 |
redefinition warnings. This used to work in 5.005, but was broken in |
3774 |
5.6 for most subroutines. For subs created via XS that redefine |
3775 |
subroutines from the C<autouse> package, this stopped working in 5.10. |
3776 |
|
3777 |
=item * |
3778 |
|
3779 |
New XSUBs now produce redefinition warnings if they overwrite existing |
3780 |
subs, as they did in 5.8.x. (The C<autouse> logic was reversed in |
3781 |
5.10-14. Only subroutines from the C<autouse> namespace would warn |
3782 |
when clobbered.) |
3783 |
|
3784 |
=item * |
3785 |
|
3786 |
C<newCONSTSUB> used to use compile-time warning hints, instead of |
3787 |
run-time hints. The following code should never produce a redefinition |
3788 |
warning, but it used to, if C<newCONSTSUB> redefined an existing |
3789 |
subroutine: |
3790 |
|
3791 |
use warnings; |
3792 |
BEGIN { |
3793 |
no warnings; |
3794 |
some_XS_function_that_calls_new_CONSTSUB(); |
3795 |
} |
3796 |
|
3797 |
=item * |
3798 |
|
3799 |
Redefinition warnings for constant subroutines are on by default (what |
3800 |
are known as severe warnings in L<perldiag>). This was only the case |
3801 |
when it was a glob assignment or declaration of a Perl subroutine that |
3802 |
caused the warning. If the creation of XSUBs triggered the warning, it |
3803 |
was not a default warning. This has been corrected. |
3804 |
|
3805 |
=item * |
3806 |
|
3807 |
The internal check to see whether a redefinition warning should occur |
3808 |
used to emit "uninitialized" warnings in cases like this: |
3809 |
|
3810 |
use warnings "uninitialized"; |
3811 |
use constant {u => undef, v => undef}; |
3812 |
sub foo(){u} |
3813 |
sub foo(){v} |
3814 |
|
3815 |
=back |
3816 |
|
3817 |
=head2 Overloading |
3818 |
|
3819 |
=over |
3820 |
|
3821 |
=item * |
3822 |
|
3823 |
Arithmetic assignment (C<$left += $right>) involving overloaded objects |
3824 |
that rely on the 'nomethod' override no longer segfault when the left |
3825 |
operand is not overloaded. |
3826 |
|
3827 |
=item * |
3828 |
|
3829 |
Errors that occur when methods cannot be found during overloading now |
3830 |
mention the correct package name, as they did in 5.8.x, instead of |
3831 |
erroneously mentioning the "overload" package, as they have since 5.10.0. |
3832 |
|
3833 |
=item * |
3834 |
|
3835 |
Undefining C<%overload::> no longer causes a crash. |
3836 |
|
3837 |
=back |
3838 |
|
3839 |
=head2 Fixes to the C<sort> operator |
3840 |
|
3841 |
=over |
3842 |
|
3843 |
=item * |
3844 |
|
3845 |
C<sort> was not treating C<sub {}> and C<sub {()}> as equivalent when |
3846 |
such a sub was provided as the comparison routine. It used to croak on |
3847 |
C<sub {()}>. |
3848 |
|
3849 |
=item * |
3850 |
|
3851 |
C<sort> now works once more with custom sort routines that are XSUBs. It |
3852 |
stopped working in 5.10.0. |
3853 |
|
3854 |
=item * |
3855 |
|
3856 |
C<sort> with a constant for a custom sort routine, although it produces |
3857 |
unsorted results, no longer crashes. It started crashing in 5.10.0. |
3858 |
|
3859 |
=item * |
3860 |
|
3861 |
Warnings emitted by C<sort> when a custom comparison routine returns a |
3862 |
non-numeric value now contain "in sort" and show the line number of the |
3863 |
C<sort> operator, rather than the last line of the comparison routine. The |
3864 |
warnings also occur now only if warnings are enabled in the scope where |
3865 |
C<sort> occurs. Previously the warnings would occur if enabled in the |
3866 |
comparison routine's scope. |
3867 |
|
3868 |
=item * |
3869 |
|
3870 |
C<< sort { $a <=> $b } >>, which is optimised internally, now produces |
3871 |
"uninitialized" warnings for NaNs (not-a-number values), since C<< <=> >> |
3872 |
returns C<undef> for those. This brings it in line with |
3873 |
S<C<< sort { 1; $a <=> $b } >>> and other more complex cases, which are not |
3874 |
optimised [perl #94390]. |
3875 |
|
3876 |
=back |
3877 |
|
3878 |
=head2 Fixes affecting the debugger |
3879 |
|
3880 |
=over |
3881 |
|
3882 |
=item * |
3883 |
|
3884 |
F<dumpvar.pl>, and consequently the C<x> command in the debugger, have been |
3885 |
fixed to handle objects blessed into classes whose names contain "=". The |
3886 |
contents of such objects used not to be dumped [perl #101814]. |
3887 |
|
3888 |
=item * |
3889 |
|
3890 |
The "R" command for restarting a debugger session has been fixed to work on |
3891 |
Windows, or any other system lacking a C<POSIX::_SC_OPEN_MAX> constant |
3892 |
[perl #87740]. |
3893 |
|
3894 |
=item * |
3895 |
|
3896 |
The C<#line 42 foo> directive used not to update the arrays of lines used |
3897 |
by the debugger if it occurred in a string eval. This was partially fixed |
3898 |
in 5.14, but it only worked for a single C<#line 42 foo> in each eval. Now |
3899 |
it works for multiple. |
3900 |
|
3901 |
=item * |
3902 |
|
3903 |
When subroutine calls are intercepted by the debugger, the name of the |
3904 |
subroutine or a reference to it is stored in C<$DB::sub>, for the debugger |
3905 |
to access. In some cases (such as C<$foo = *bar; undef *bar; &$foo>) |
3906 |
C<$DB::sub> would be set to a name that could not be used to find the |
3907 |
subroutine, and so the debugger's attempt to call it would fail. Now the |
3908 |
check to see whether a reference is needed is more robust, so those |
3909 |
problems should not happen anymore [rt.cpan.org #69862]. |
3910 |
|
3911 |
=item * |
3912 |
|
3913 |
Every subroutine has a filename associated with it that the debugger uses. |
3914 |
The one associated with constant subroutines used to be misallocated when |
3915 |
cloned under threads. Consequently, debugging threaded applications could |
3916 |
result in memory corruption [perl #96126]. |
3917 |
|
3918 |
=back |
3919 |
|
3920 |
=head2 Fixes to the C<glob> operator |
3921 |
|
3922 |
=over |
3923 |
|
3924 |
=item * |
3925 |
|
3926 |
On OSes other than VMS, Perl's C<glob> operator (and the C<< <...> >> form) |
3927 |
use L<File::Glob> underneath. L<File::Glob> splits the pattern into words, |
3928 |
before feeding each word to its C<bsd_glob> function. |
3929 |
|
3930 |
There were several inconsistencies in the way the split was done. Now |
3931 |
quotation marks (' and ") are always treated as shell-style word delimiters |
3932 |
(that allow whitespace as part of a word) and backslashes are always |
3933 |
preserved, unless they exist to escape quotation marks. Before, those |
3934 |
would only sometimes be the case, depending on whether the pattern |
3935 |
contained whitespace. Also, escaped whitespace at the end of the pattern |
3936 |
is no longer stripped [perl #40470]. |
3937 |
|
3938 |
=item * |
3939 |
|
3940 |
C<CORE::glob> now works as a way to call the default globbing function. It |
3941 |
used to respect overrides, despite the C<CORE::> prefix. |
3942 |
|
3943 |
=item * |
3944 |
|
3945 |
Under miniperl (used to configure modules when perl itself is built), |
3946 |
C<glob> now clears %ENV before calling csh, since the latter croaks on some |
3947 |
systems if it does not like the contents of the LS_COLORS enviroment |
3948 |
variable [perl #98662]. |
3949 |
|
3950 |
=back |
3951 |
|
3952 |
=head2 Prototypes of built-in keywords |
3953 |
|
3954 |
=over |
3955 |
|
3956 |
=item * |
3957 |
|
3958 |
The C<prototype> function no longer dies for the C<__FILE__>, C<__LINE__> |
3959 |
and C<__PACKAGE__> directives. It now returns an empty-string prototype |
3960 |
for them, because they are syntactically indistinguishable from nullary |
3961 |
functions like C<time>. |
3962 |
|
3963 |
=item * |
3964 |
|
3965 |
C<prototype> now returns C<undef> for all overridable infix operators, |
3966 |
such as C<eq>, which are not callable in any way resembling functions. |
3967 |
It used to return incorrect prototypes for some and die for others |
3968 |
[perl #94984]. |
3969 |
|
3970 |
=item * |
3971 |
|
3972 |
The prototypes of several built-in functions--C<getprotobynumber>, C<lock>, |
3973 |
C<not> and C<select>--have been corrected, or at least are now closer to |
3974 |
reality than before. |
3975 |
|
3976 |
=back |
3977 |
|
3978 |
=head2 Bugs involving the dereferencing operators |
3979 |
|
3980 |
=over |
3981 |
|
3982 |
=item * |
3983 |
|
3984 |
C<defined(${"..."})>, C<defined(*{"..."})>, etc., used to |
3985 |
return true for most, but not all built-in variables, if |
3986 |
they had not been used yet. This bug affected C<${^GLOBAL_PHASE}> and |
3987 |
C<${^UTF8CACHE}>, among others. It also used to return false if the |
3988 |
package name was given as well (C<${"::!"}>) [perl #97978, #97492]. |
3989 |
|
3990 |
=item * |
3991 |
|
3992 |
Perl 5.10.0 introduced a similar bug: C<defined(*{"foo"})> where "foo" |
3993 |
represents the name of a built-in global variable used to return false if |
3994 |
the variable had never been used before, but only on the I<first> call. |
3995 |
This, too, has been fixed. |
3996 |
|
3997 |
=item * |
3998 |
|
3999 |
Since 5.6.0, C<*{ ... }> has been inconsistent in how it treats undefined |
4000 |
values. It would die in strict mode or lvalue context for most undefined |
4001 |
values, but would be treated as the empty string (with a warning) for the |
4002 |
specific scalar return by C<undef()> (C<&PL_sv_undef> internally). This |
4003 |
has been corrected. C<undef()> is now treated like other undefined |
4004 |
scalars, as in Perl 5.005. |
4005 |
|
4006 |
=back |
4007 |
|
4008 |
=head2 Threading bugs |
4009 |
|
4010 |
=over |
4011 |
|
4012 |
=item * |
4013 |
|
4014 |
Typeglobs returned from threads are no longer cloned if the parent thread |
4015 |
already has a glob with the same name. This means that returned |
4016 |
subroutines will now assign to the right package variables [perl #107366]. |
4017 |
|
4018 |
=item * |
4019 |
|
4020 |
Some cases of threads crashing due to memory allocation during cloning have |
4021 |
been fixed [perl #90006]. |
4022 |
|
4023 |
=item * |
4024 |
|
4025 |
Thread joining would sometimes emit "Attempt to free unreferenced scalar" |
4026 |
warnings if C<caller> had been used from the C<DB> package prior to thread |
4027 |
creation [perl #98092]. |
4028 |
|
4029 |
=item * |
4030 |
|
4031 |
Locking a subroutine (via C<lock &sub>) is no longer a compile-time error |
4032 |
for regular subs. For lvalue subroutines, it no longer tries to return the |
4033 |
sub as a scalar, resulting in strange side effects like C<ref \$_> |
4034 |
returning "CODE" in some instances. |
4035 |
|
4036 |
C<lock &sub> is now a run-time error if L<threads::shared> is loaded (a |
4037 |
no-op otherwise), but that may be rectified in a future version. |
4038 |
|
4039 |
=back |
4040 |
|
4041 |
=head2 Fixes to C<given> and C<when> |
4042 |
|
4043 |
=over |
4044 |
|
4045 |
=item * |
4046 |
|
4047 |
C<given> was not scoping its implicit $_ properly, resulting in memory |
4048 |
leaks or "Variable is not available" warnings [perl #94682]. |
4049 |
|
4050 |
=item * |
4051 |
|
4052 |
C<given> was not calling set-magic on the implicit lexical C<$_> that it |
4053 |
uses. This meant, for example, that C<pos> would be remembered from one |
4054 |
execution of the same C<given> block to the next, even if the input were a |
4055 |
different variable [perl #84526]. |
4056 |
|
4057 |
=item * |
4058 |
|
4059 |
C<when> blocks are now capable of returning variables declared inside the |
4060 |
enclosing C<given> block [perl #93548]. |
4061 |
|
4062 |
=back |
4063 |
|
4064 |
=head2 Fixes to the C<substr> operator |
4065 |
|
4066 |
=over |
4067 |
|
4068 |
=item * |
4069 |
|
4070 |
Tied (and otherwise magical) variables are no longer exempt from the |
4071 |
"Attempt to use reference as lvalue in substr" warning. |
4072 |
|
4073 |
=item * |
4074 |
|
4075 |
That warning now occurs when the returned lvalue is assigned to, not |
4076 |
when C<substr> itself is called. This only makes a difference if the |
4077 |
return value of C<substr> is referenced and assigned to later. |
4078 |
|
4079 |
=item * |
4080 |
|
4081 |
Passing a substring of a read-only value or a typeglob to a function |
4082 |
(potential lvalue context) no longer causes an immediate "Can't coerce" |
4083 |
or "Modification of a read-only value" error. That error only occurs |
4084 |
if and when the value passed is assigned to. |
4085 |
|
4086 |
The same thing happens with the "substr outside of string" error. If |
4087 |
the lvalue is only read, not written to, it is now just a warning, as |
4088 |
with rvalue C<substr>. |
4089 |
|
4090 |
=item * |
4091 |
|
4092 |
C<substr> assignments no longer call FETCH twice if the first argument |
4093 |
is a tied variable, just once. |
4094 |
|
4095 |
=back |
4096 |
|
4097 |
=head2 Fixes affecting the C API |
4098 |
|
4099 |
=over |
4100 |
|
4101 |
=item * |
4102 |
|
4103 |
The C<newHVhv> XS function now works on tied hashes, instead of crashing or |
4104 |
returning an empty hash. |
4105 |
|
4106 |
=item * |
4107 |
|
4108 |
The C<SvIsCOW> C macro now returns false for read-only copies of typeglobs, |
4109 |
such as those created by: |
4110 |
|
4111 |
$hash{elem} = *foo; |
4112 |
Hash::Util::lock_value %hash, 'elem'; |
4113 |
|
4114 |
It used to return true. |
4115 |
|
4116 |
=item * |
4117 |
|
4118 |
The C<SvPVutf8> C function no longer tries to modify its argument, |
4119 |
resulting in errors [perl #108994]. |
4120 |
|
4121 |
=item * |
4122 |
|
4123 |
C<SvPVutf8> now works properly with magical variables. |
4124 |
|
4125 |
=item * |
4126 |
|
4127 |
C<SvPVbyte> now works properly non-PVs. |
4128 |
|
4129 |
=item * |
4130 |
|
4131 |
When presented with malformed UTF-8 input, the XS-callable functions |
4132 |
C<is_utf8_string()>, C<is_utf8_string_loc()>, and |
4133 |
C<is_utf8_string_loclen()> could read beyond the end of the input |
4134 |
string by up to 12 bytes. This no longer happens. [perl #32080]. |
4135 |
However, currently, C<is_utf8_char()> still has this defect, see |
4136 |
L</is_utf8_char()> above. |
4137 |
|
4138 |
=item * |
4139 |
|
4140 |
The C-level C<pregcomp> function could become confused as to whether the |
4141 |
pattern was in UTF8 if the pattern was an overloaded, tied, or otherwise |
4142 |
magical scalar [perl #101940]. |
4143 |
|
4144 |
=back |
4145 |
|
4146 |
=head2 Other notable fixes |
4147 |
|
4148 |
=over |
4149 |
|
4150 |
=item * |
4151 |
|
4152 |
C<~~> now correctly handles the precedence of Any~~Object, and is not tricked |
4153 |
by an overloaded object on the left-hand side. |
4154 |
|
4155 |
=item * |
4156 |
|
4157 |
C<quotemeta> now quotes consistently the same non-ASCII characters under |
4158 |
C<use feature 'unicode_strings'>, regardless of whether the string is |
4159 |
encoded in UTF-8 or not, hence fixing the last vestiges (we hope) of the |
4160 |
infamous L<perlunicode/The "Unicode Bug">. [perl #77654]. |
4161 |
|
4162 |
Which of these code points is quoted has changed, based on Unicode's |
4163 |
recommendations. See L<perlfunc/quotemeta> for details. |
4164 |
|
4165 |
=item * |
4166 |
|
4167 |
No warning for C<open(foo::bar)> |
4168 |
|
4169 |
When one writes C<open foo || die>, which used to work in Perl 4, a |
4170 |
"Precedence problem" warning is produced. This warning used erroneously to |
4171 |
apply to fully-qualified bareword handle names not followed by C<||>. This |
4172 |
has been corrected. |
4173 |
|
4174 |
=item * |
4175 |
|
4176 |
C<select> and package aliasing |
4177 |
|
4178 |
After package aliasing (C<*foo:: = *bar::>), C<select> with 0 or 1 argument |
4179 |
would sometimes return a name that could not be used to refer to the |
4180 |
filehandle, or sometimes it would return C<undef> even when a filehandle |
4181 |
was selected. Now it returns a typeglob reference in such cases. |
4182 |
|
4183 |
=item * |
4184 |
|
4185 |
C<PerlIO::get_layers> and numbers |
4186 |
|
4187 |
C<PerlIO::get_layers> no longer ignores some arguments that it thinks are |
4188 |
numeric, while treating others as filehandle names. It is now consistent |
4189 |
for flat scalars (i.e., not references). |
4190 |
|
4191 |
=item * |
4192 |
|
4193 |
Unrecognised switches on C<#!> line |
4194 |
|
4195 |
If a switch, such as B<-x>, that cannot occur on the C<#!> line is used |
4196 |
there, perl dies with "Can't emulate...". |
4197 |
|
4198 |
It used to produce the same message for switches that perl did not |
4199 |
recognise at all, whether on the command line or the C<#!> line. |
4200 |
|
4201 |
Now it produces the "Unrecognized switch" error message [perl #104288]. |
4202 |
|
4203 |
=item * |
4204 |
|
4205 |
C<system> and SIGCHLD |
4206 |
|
4207 |
C<system> now temporarily blocks the SIGCHLD signal handler, to prevent the |
4208 |
signal handler from stealing the exit status [perl #105700]. |
4209 |
|
4210 |
=item * |
4211 |
|
4212 |
C<(s)printf>'s %n formatting code |
4213 |
|
4214 |
The %n formatting code, which causes the number of characters to be |
4215 |
assigned to the next argument to C<printf> or C<sprintf> now actually |
4216 |
assigns the number of characters, instead of the number of bytes. |
4217 |
|
4218 |
It also works now with special lvalue functions like C<substr> and with |
4219 |
nonexistent hash and array elements [perl #3471, #103492]. |
4220 |
|
4221 |
=item * |
4222 |
|
4223 |
C<local $_> |
4224 |
|
4225 |
In Perl 5.14, C<local $_> was changed to create a new variable not tied to |
4226 |
anything, even if $_ was tied before that. But, due to an oversight, it |
4227 |
would still call FETCH once on a tied $_ before replacing it with the new |
4228 |
variable. This has been fixed [perl #105912]. |
4229 |
|
4230 |
=item * |
4231 |
|
4232 |
Perl skips copying values returned from a subroutine, for the sake of |
4233 |
speed, if doing so would make no observable difference. Due to faulty |
4234 |
logic, this would happen with the |
4235 |
result of C<delete>, C<shift> or C<splice>, even if the result was |
4236 |
referenced elsewhere. It also did so with tied variables about to be freed |
4237 |
[perl #91844, #95548]. |
4238 |
|
4239 |
|
4240 |
=item * |
4241 |
|
4242 |
C<utf8::decode> now refuses to modify read-only scalars [perl #91850]. |
4243 |
|
4244 |
=item * |
4245 |
|
4246 |
Freeing $_ inside a C<grep> or C<map> block, a code block embedded in a |
4247 |
regular expression, or an @INC filter (a subroutine returned by a |
4248 |
subroutine in @INC) used to result in double frees or crashes |
4249 |
[perl #91880, #92254, #92256]. |
4250 |
|
4251 |
=item * |
4252 |
|
4253 |
C<@&> and C<$&> |
4254 |
|
4255 |
Mentioning a variable named "&" other than C<$&> (i.e., C<@&> or C<%&>) no |
4256 |
longer stops C<$&> from working. The same applies to variables named "'" |
4257 |
and "`" [perl #24237]. |
4258 |
|
4259 |
=item * |
4260 |
|
4261 |
Return value of C<eval> |
4262 |
|
4263 |
C<eval> returns C<undef> in scalar context or an empty list in list |
4264 |
context when there is a run-time error. When C<eval> was passed a |
4265 |
string in list context and a syntax error occurred, it used to return a |
4266 |
list containing a single undefined element. Now it returns an empty |
4267 |
list in list context for all errors [perl #80630]. |
4268 |
|
4269 |
=item * |
4270 |
|
4271 |
C<goto &func> no longer crashes, but produces an error message, when |
4272 |
the unwinding of the current subroutine's scope fires a destructor that |
4273 |
undefines the subroutine being "goneto" [perl #99850]. |
4274 |
|
4275 |
=item * |
4276 |
|
4277 |
Creating a C<UNIVERSAL::AUTOLOAD> sub no longer stops C<%+>, C<%-> and |
4278 |
C<%!> from working some of the time [perl #105024]. |
4279 |
|
4280 |
=item * |
4281 |
|
4282 |
Perl now holds an extra reference count on the package that code is |
4283 |
currently compiling in. This means that the following code no longer crashes [perl #101486]: |
4284 |
|
4285 |
package Foo; |
4286 |
BEGIN {*Foo:: = *Bar::} |
4287 |
sub foo; |
4288 |
|
4289 |
=item * |
4290 |
|
4291 |
The C<x> repetition operator no longer crashes on 64-bit builds with large |
4292 |
repeat counts [perl #94560]. |
4293 |
|
4294 |
=item * |
4295 |
|
4296 |
Calling C<require> on an implicit C<$_> when C<*CORE::GLOBAL::require> has |
4297 |
been overridden does not segfault anymore, and C<$_> is now passed to the |
4298 |
overriding subroutine [perl #78260]. |
4299 |
|
4300 |
=item * |
4301 |
|
4302 |
In Perl 5.14.0, C<$tainted ~~ @array> stopped working properly. Sometimes |
4303 |
it would erroneously fail (when C<$tainted> contained a string that occurs |
4304 |
in the array I<after> the first element) or erroneously succeed (when |
4305 |
C<undef> occurred after the first element) [perl #93590]. |
4306 |
|
4307 |
=item * |
4308 |
|
4309 |
C<use> and C<require> are no longer affected by the I/O layers active in |
4310 |
the caller's scope (enabled by L<open.pm|open>) [perl #96008]. |
4311 |
|
4312 |
=item * |
4313 |
|
4314 |
C<our $::é; $é> (which is invalid) no longer produces the "Compilation |
4315 |
error at lib/utf8_heavy.pl..." error message, which it started emitting in |
4316 |
5.10.0 [perl #99984]. |
4317 |
|
4318 |
=item * |
4319 |
|
4320 |
On 64-bit systems, C<read()> now understands large string offsets beyond |
4321 |
the 32-bit range. |
4322 |
|
4323 |
=item * |
4324 |
|
4325 |
Errors that occur when processing subroutine attributes no longer cause the |
4326 |
subroutine's op tree to leak. |
4327 |
|
4328 |
=item * |
4329 |
|
4330 |
Passing the same constant subroutine to both C<index> and C<formline> no |
4331 |
longer causes one or the other to fail [perl #89218]. (5.14.1) |
4332 |
|
4333 |
=item * |
4334 |
|
4335 |
List assignment to lexical variables declared with attributes in the same |
4336 |
statement (C<my ($x,@y) : blimp = (72,94)>) stopped working in Perl 5.8.0. |
4337 |
It has now been fixed. |
4338 |
|
4339 |
=item * |
4340 |
|
4341 |
Perl 5.10.0 introduced some faulty logic that made "U*" in the middle of |
4342 |
a pack template equivalent to "U0" if the input string was empty. This has |
4343 |
been fixed [perl #90160]. |
4344 |
|
4345 |
=item * |
4346 |
|
4347 |
Destructors on objects were not called during global destruction on objects |
4348 |
that were not referenced by any scalars. This could happen if an array |
4349 |
element were blessed (e.g., C<bless \$a[0]>) or if a closure referenced a |
4350 |
blessed variable (C<bless \my @a; sub foo { @a }>). |
4351 |
|
4352 |
Now there is an extra pass during global destruction to fire destructors on |
4353 |
any objects that might be left after the usual passes that check for |
4354 |
objects referenced by scalars [perl #36347]. |
4355 |
|
4356 |
This bug fix was added in Perl 5.13.9, but caused problems with some CPAN |
4357 |
modules that were relying on the bug. Since it was so close to Perl |
4358 |
5.14.0, the fix was reverted in 5.13.10, to allow more time for the modules |
4359 |
to adapt. Hopefully they will be fixed soon (see L</Known Problems>, |
4360 |
below). |
4361 |
|
4362 |
=item * |
4363 |
|
4364 |
Fixed a case where it was possible that a freed buffer may have been read |
4365 |
from when parsing a here document [perl #90128]. (5.14.1) |
4366 |
|
4367 |
=item * |
4368 |
|
4369 |
C<each(I<ARRAY>)> is now wrapped in C<defined(...)>, like C<each(I<HASH>)>, |
4370 |
inside a C<while> condition [perl #90888]. |
4371 |
|
4372 |
=item * |
4373 |
|
4374 |
A problem with context propagation when a C<do> block is an argument to |
4375 |
C<return> has been fixed. It used to cause C<undef> to be returned in |
4376 |
some cases of a C<return> inside an C<if> block which itself is followed by |
4377 |
another C<return>. |
4378 |
|
4379 |
=item * |
4380 |
|
4381 |
Calling C<index> with a tainted constant no longer causes constants in |
4382 |
subsequently compiled code to become tainted [perl #64804]. |
4383 |
|
4384 |
=item * |
4385 |
|
4386 |
Infinite loops like C<1 while 1> used to stop C<strict 'subs'> mode from |
4387 |
working for the rest of the block.t |
4388 |
|
4389 |
=item * |
4390 |
|
4391 |
For list assignments like C<($a,$b) = ($b,$a)>, Perl has to make a copy of |
4392 |
the items on the right-hand side before assignment them to the left. For |
4393 |
efficiency's sake, it assigns the values on the right straight to the items |
4394 |
on the left no variable is mentioned on both sides, as in |
4395 |
C<($a,$b) = ($c,$d)>. The logic for determining when it can cheat was |
4396 |
faulty, in that C<&&> and C<||> on the right-hand side could fool it. So |
4397 |
C<($a,$b) = $some_true_value && ($b,$a)> would end up assigning the value |
4398 |
of C<$b> to both scalars. |
4399 |
|
4400 |
=item * |
4401 |
|
4402 |
Perl no longer tries to apply lvalue context to the string in |
4403 |
C<("string", $variable) ||= 1> (which used to be an error). Since the |
4404 |
left-hand side of C<||=> is evaluated in scalar context, that's a scalar |
4405 |
comma operator, which gives all but the last item void context. There is |
4406 |
no such thing as void lvalue context, so it was a mistake for Perl to try |
4407 |
to force it [perl #96942]. |
4408 |
|
4409 |
=item * |
4410 |
|
4411 |
C<caller> no longer leaks memory when called from the DB package if |
4412 |
C<@DB::args> was assigned to after the first call to C<caller>. L<Carp> |
4413 |
was triggering this bug [perl #97010]. |
4414 |
|
4415 |
=item * |
4416 |
|
4417 |
C<close> and similar filehandle functions, when called on built-in global |
4418 |
variables (like C<$+>), used to die if the variable happened to hold the |
4419 |
undefined value, instead of producing the usual "Use of uninitialized |
4420 |
value" warning. |
4421 |
|
4422 |
=item * |
4423 |
|
4424 |
When autovivified file handles were introduced in Perl 5.6.0, C<readline> |
4425 |
was inadvertently made to autovivify when called as C<readline($foo)> (but |
4426 |
not as C<E<lt>$fooE<gt>>). It has now been fixed never to autovivify. |
4427 |
|
4428 |
=item * |
4429 |
|
4430 |
Calling an undefined anonymous subroutine (e.g., what $x holds after |
4431 |
C<undef &{$x = sub{}}>) used to cause a "Not a CODE reference" error, which |
4432 |
has been corrected to "Undefined subroutine called" [perl #71154]. |
4433 |
|
4434 |
=item * |
4435 |
|
4436 |
Causing C<@DB::args> to be freed between uses of C<caller> no longer |
4437 |
results in a crash [perl #93320]. |
4438 |
|
4439 |
=item * |
4440 |
|
4441 |
C<setpgrp($foo)> used to be equivalent to C<($foo, setpgrp)>, because |
4442 |
C<setpgrp> was ignoring its argument if there was just one. Now it is |
4443 |
equivalent to C<setpgrp($foo,0)>. |
4444 |
|
4445 |
=item * |
4446 |
|
4447 |
C<shmread> was not setting the scalar flags correctly when reading from |
4448 |
shared memory, causing the existing cached numeric representation in the |
4449 |
scalar to persist [perl #98480]. |
4450 |
|
4451 |
=item * |
4452 |
|
4453 |
C<++> and C<--> now work on copies of globs, instead of dying. |
4454 |
|
4455 |
=item * |
4456 |
|
4457 |
C<splice()> doesn't warn when truncating |
4458 |
|
4459 |
You can now limit the size of an array using C<splice(@a,MAX_LEN)> without |
4460 |
worrying about warnings. |
4461 |
|
4462 |
=item * |
4463 |
|
4464 |
C<< $$ >> is no longer tainted. Since this value comes directly from |
4465 |
C<< getpid() >>, it is always safe. |
4466 |
|
4467 |
=item * |
4468 |
|
4469 |
The parser no longer leaks a filehandle if STDIN was closed before parsing |
4470 |
started [perl #37033]. |
4471 |
|
4472 |
=item * |
4473 |
|
4474 |
C<< die; >> with a non-reference, non-string, or magical (e.g., tainted) |
4475 |
value in $@ now properly |
4476 |
propagates that value [perl #111654]. |
4477 |
|
4478 |
=back |
4479 |
|
4480 |
=head1 Known Problems |
4481 |
|
4482 |
=over 4 |
4483 |
|
4484 |
=item * |
4485 |
|
4486 |
On Solaris, we have two kinds of failure. |
4487 |
|
4488 |
If F<make> is Sun's F<make≥>, we get an error about a badly formed macro |
4489 |
assignment in the F<Makefile>. That happens when F<./Configure> tries to |
4490 |
make depends. F<Configure> then exits 0, but further F<make>-ing fails. |
4491 |
|
4492 |
If F<make> is F<gmake>, F<Configure> completes, then we get errors related |
4493 |
to F</usr/include/stdbool.h> |
4494 |
|
4495 |
=item * |
4496 |
|
4497 |
The following CPAN modules have test failures with perl 5.16. Patches have |
4498 |
been submitted for all of these, so hopefully there will be new releases |
4499 |
soon: |
4500 |
|
4501 |
=over |
4502 |
|
4503 |
=item * |
4504 |
|
4505 |
L<Date::Pcalc> version 6.1 |
4506 |
|
4507 |
=item * |
4508 |
|
4509 |
L<Encode::JP::Mobile> version 0.27 |
4510 |
|
4511 |
=item * |
4512 |
|
4513 |
L<Module::CPANTS::Analyse> version 0.85 |
4514 |
|
4515 |
This fails due to problems in L<Module::Find> 0.10 and L<File::MMagic> |
4516 |
1.27. |
4517 |
|
4518 |
=item * |
4519 |
|
4520 |
L<PerlIO::Util> version 0.72 |
4521 |
|
4522 |
=back |
4523 |
|
4524 |
=back |
4525 |
|
4526 |
=head1 Obituary |
4527 |
|
4528 |
XXX If any significant core contributor has died, we've added a short obituary |
4529 |
here. |
4530 |
|
4531 |
=head1 Acknowledgements |
4532 |
|
4533 |
XXX Generate this with: |
4534 |
|
4535 |
perl Porting/acknowledgements.pl v5.14.0..HEAD |
4536 |
|
4537 |
=head1 Reporting Bugs |
4538 |
|
4539 |
If you find what you think is a bug, you might check the articles |
4540 |
recently posted to the comp.lang.perl.misc newsgroup and the perl |
4541 |
bug database at L<http://rt.perl.org/perlbug/>. There may also be |
4542 |
information at L<http://www.perl.org/>, the Perl Home Page. |
4543 |
|
4544 |
If you believe you have an unreported bug, please run the L<perlbug> |
4545 |
program included with your release. Be sure to trim your bug down |
4546 |
to a tiny but sufficient test case. Your bug report, along with the |
4547 |
output of C<perl -V>, will be sent off to perlbug@perl.org to be |
4548 |
analysed by the Perl porting team. |
4549 |
|
4550 |
If the bug you are reporting has security implications, which make it |
4551 |
inappropriate to send to a publicly archived mailing list, then please |
4552 |
send it to perl5-security-report@perl.org. This points to a closed |
4553 |
subscription unarchived mailing list, which includes all the core |
4554 |
committers, who will be able to help assess the impact of issues, figure |
4555 |
out a resolution, and help co-ordinate the release of patches to |
4556 |
mitigate or fix the problem across all platforms on which Perl is |
4557 |
supported. Please only use this address for security issues in the Perl |
4558 |
core, not for modules independently distributed on CPAN. |
4559 |
|
4560 |
=head1 SEE ALSO |
4561 |
|
4562 |
The F<Changes> file for an explanation of how to view exhaustive details |
4563 |
on what changed. |
4564 |
|
4565 |
The F<INSTALL> file for how to build Perl. |
4566 |
|
4567 |
The F<README> file for general stuff. |
4568 |
|
4569 |
The F<Artistic> and F<Copying> files for copyright information. |
4570 |
|
4571 |
=cut |