=encoding utf8 =head1 NAME =begin original perl5160delta - what is new for perl v5.16.0 =end original perl5160delta - perl v5.16.0 での変更点 =head1 DESCRIPTION =begin original This document describes differences between the 5.14.0 release and the 5.16.0 release. =end original この文書は 5.14.0 リリースと 5.16.0 リリースの変更点を記述しています。 =begin original If you are upgrading from an earlier release such as 5.12.0, first read L, which describes differences between 5.12.0 and 5.14.0. =end original 5.12.0 のような以前のリリースから更新する場合は、まず 5.12.0 と 5.14.0 の違いについて記述している L を読んでください。 =begin original Some bug fixes in this release have been backported to later releases of 5.14.x. Those are indicated with the 5.14.x version in parentheses. =end original このリリースでのバグ修正のいくつかは 5.14.x のリリースに バックポートされました。 そのようなものはかっこの中に 5.14.x のバージョン番号を書いて示しています。 =head1 Notice =begin original With the release of Perl 5.16.0, the 5.12.x series of releases is now out of its support period. There may be future 5.12.x releases, but only in the event of a critical security issue. Users of Perl 5.12 or earlier should consider upgrading to a more recent release of Perl. =end original Perl 5.16.0 のリリースによって、5.12.x リリースシリーズはサポート期間が 終了します。 将来 5.12.x リリースがあるかもしれませんが、それは重大なセキュリティ問題が あった場合のみです。 Perl 5.12 以前のユーザーはより新しい Perl にアップグレードすることを 検討するべきです。 =begin original This policy is described in greater detail in L. =end original このポリシーは L に より詳細に記述されています。 =head1 Core Enhancements (コアの拡張) =head2 C> =begin original As of this release, version declarations like C now disable all features before enabling the new feature bundle. This means that the following holds true: =end original このリリース以降、C のようなバージョン宣言は、新しい機能が 有効になる前の全ての機能が無効になるようになりました。 これにより、以下のようなものが真になります: use 5.016; # only 5.16 features enabled here use 5.014; # only 5.14 features enabled here (not 5.16) =begin original C and higher continue to enable strict, but explicit C and C now override the version declaration, even when they come first: =end original C 以上は strict を有効にするという機能ははそのままですが、 明示的な C と C は (先に現れても) バージョン定義を 上書きするようになりました: no strict; use 5.012; # no strict here =begin original There is a new ":default" feature bundle that represents the set of features enabled before any version declaration or C has been seen. Version declarations below 5.10 now enable the ":default" feature set. This does not actually change the behavior of C, because features added to the ":default" set are those that were traditionally enabled by default, before they could be turned off. =end original 新しい ":default" 機能は、任意のバージョン定義や C が 現れる前に有効な機能の集合を表現します。 5.10 以前のバージョン宣言は ":default" 機能集合を有効にするように なりました。 これは実際には C の振る舞いを変更しません; なぜなら ":default" 集合は、機能を無効に出来るようになる前に伝統的にデフォルトで 有効になっていたものだからです。 =begin original C<< no feature >> now resets to the default feature set. To disable all features (which is likely to be a pretty special-purpose request, since it presumably won't match any named set of semantics) you can now write C<< no feature ':all' >>. =end original C<< no feature >> はデフォルト機能集合をリセットするようになりました。 全ての機能を無効にする (これはかなり特殊な用途の要求です; なぜなら おそらく動作の全ての名前付き集合にマッチングしないからです) には、 C<< no feature ':all' >> と書けるようになります。 =begin original C<$[> is now disabled under C. It is part of the default feature set and can be turned on or off explicitly with C. =end original C<$[> は C の元では無効になるようになりました。 これはデフォルト機能集合の一部で、 C によって 明示的に有効無効を切り替えられます。 =head2 C<__SUB__> =begin original The new C<__SUB__> token, available under the C feature (see L) or C, returns a reference to the current subroutine, making it easier to write recursive closures. =end original C 機能 (L 参照) または C で利用可能な C<__SUB__> トークンは現在のサブルーチンへのリファレンスを返すことで、 再帰クロージャを書くのを容易にします。 =head2 New and Improved Built-ins (新規または改良された組み込み関数) =head3 More consistent C (より一貫性のある C) =begin original The C operator sometimes treats a string argument as a sequence of characters and sometimes as a sequence of bytes, depending on the internal encoding. The internal encoding is not supposed to make any difference, but there is code that relies on this inconsistency. =end original C 演算子は内部エンコーディングに依存して、時には文字列引数を 文字の並びとして、時にはバイトの並びとして扱います。 内部エンコーディングは何の違いもないはずですが、この非一貫性に依存した コードがあります。 =begin original The new C and C features (enabled under C) resolve this. The C feature causes C to treat the string always as Unicode. The C features provides a function, itself called C, which evaluates its argument always as a string of bytes. =end original (C で有効になる)新しい C 機能と C 機能はこれを解決します。 C 機能は、C での文字列を常に Unicode として 扱います。 C 機能は、引数を常にバイト列として扱う C 関数を 提供します。 =begin original These features also fix oddities with source filters leaking to outer dynamic scopes. =end original これらの機能は、ソースフィルタが外側の動的スコープにリークする問題も 修正します。 =begin original See L for more detail. =end original さらなる詳細については L を参照してください。 =head3 C lvalue revamp (C 左辺値の刷新) =for comment Does this belong here, or under Incompatible Changes? =begin original When C is called in lvalue or potential lvalue context with two or three arguments, a special lvalue scalar is returned that modifies the original string (the first argument) when assigned to. =end original 左辺値や潜在的な左辺値コンテキストで 2 引数または 3 引数の C が 呼び出されると、代入するときに元の文字列(1 番目の引数)を修正する 特殊な左辺値スカラを返します。 =begin original Previously, the offsets (the second and third arguments) passed to C would be converted immediately to match the string, negative offsets being translated to positive and offsets beyond the end of the string being truncated. =end original 以前は、C に渡されたオフセット(2 番目と 3 番目の引数) は直ちに 文字列にマッチするように変換され、負のオフセットは正に変換され、 文字列の末尾を越えるオフセットは切り詰められました。 =begin original Now, the offsets are recorded without modification in the special lvalue scalar that is returned, and the original string is not even looked at by C itself, but only when the returned lvalue is read or modified. =end original 今では、オフセットは返される特殊左辺値スカラに修正なしに記録され、 元の文字列は C 自身によっても見ませんが、返された左辺値は 読んだり修正したりしたときだけです。 =begin original These changes result in an incompatible change: =end original これらの変更はいくつかの互換性のない変更を引き起こします: =begin original If the original string changes length after the call to C but before assignment to its return value, negative offsets will remember their position from the end of the string, affecting code like this: =end original C を呼び出した後、返り値が代入される前に、元の文字列の長さが 変更されると、負のオフセットは文字列の末尾からの位置を覚えているので、 以下のようなコードに影響を与えます: my $string = "string"; my $lvalue = \substr $string, -4, 2; print $$lvalue, "\n"; # prints "ri" $string = "bailing twine"; print $$lvalue, "\n"; # prints "wi"; used to print "il" =begin original The same thing happens with an omitted third argument. The returned lvalue will always extend to the end of the string, even if the string becomes longer. =end original 同じことは省略された 3 番目の引数でも起こります。 返された左辺値は、たとえ文字列が長くなっても、常に文字列の末尾に 拡張されます。 =begin original Since this change also allowed many bugs to be fixed (see L operator>), and since the behavior of negative offsets has never been specified, the change was deemed acceptable. =end original この変更により多くのバグを修正できるようになり、 L operator> を参照してください)、 負数のオフセットの振る舞いは仕様になったことはないので、この変更は 受け入れられる取引でした。 =head3 Return value of C (C の返り値) =begin original The value returned by C on a tied variable is now the actual scalar that holds the object to which the variable is tied. This lets ties be weakened with C. =end original tie された変数に対する C によって返される値は、変数が tie された オブジェクトを保持する実際のスカラになりました。 これにより tie は C によって 弱められます。 =head2 Unicode Support (Unicode 対応) =head3 Supports (I) Unicode 6.1 ((I<ほぼ>) Unicode 6.1 対応) =begin original Besides the addition of whole new scripts, and new characters in existing scripts, this new version of Unicode, as always, makes some changes to existing characters. One change that may trip up some applications is that the General Category of two characters in the Latin-1 range, PILCROW SIGN and SECTION SIGN, has been changed from Other_Symbol to Other_Punctuation. The same change has been made for a character in each of Tibetan, Ethiopic, and Aegean. The code points U+3248..U+324F (CIRCLED NUMBER TEN ON BLACK SQUARE through CIRCLED NUMBER EIGHTY ON BLACK SQUARE) have had their General Category changed from Other_Symbol to Other_Numeric. The Line Break property has changes for Hebrew and Japanese; and because of other changes in 6.1, the Perl regular expression construct C<\X> now works differently for some characters in Thai and Lao. =end original 完全に新しい用字や、既にある用字への新しい文字の他に、新しい Unicode はいつも通り、既にある文字もいくつか変更しています。 アプリケーションをつまずかせるかもしれない変更の一つは、 Latin-1 の範囲にある二つの文字 PILCROW SIGN および SECTION SIGN の 一般カテゴリは Other_Symbol から Other_Punctuation に変更されました。 同じ変更はチベット語、エチオピア語、エーゲ語の文字に対しても行われました。 符号位置 U+3248..U+324F (CIRCLED NUMBER TEN ON BLACK SQUARE から CIRCLED NUMBER EIGHTY ON BLACK SQUARE) の一般カテゴリは Other_Symbol から Other_Numeric に変更されました。 Line Break 特性はヘブライ語と日本語で変更されました; そして 6.1 での その他の変更により、Perl の正規表現構造 C<\X> はタイとラオスの いくつかの文字では異なった動作をします。 =begin original New aliases (synonyms) have been defined for many property values; these, along with the previously existing ones, are all cross-indexed in L. =end original 新しい別名が多くの特性値に定義されました; これらは、既に存在するものと あわせて、全て L にクロスインデックスされています。 =begin original The return value of C is affected by other changes: =end original C の帰り値はその他の変更の影響を受けます: Code point Old Name New Name U+000A LINE FEED (LF) LINE FEED U+000C FORM FEED (FF) FORM FEED U+000D CARRIAGE RETURN (CR) CARRIAGE RETURN U+0085 NEXT LINE (NEL) NEXT LINE U+008E SINGLE-SHIFT 2 SINGLE-SHIFT-2 U+008F SINGLE-SHIFT 3 SINGLE-SHIFT-3 U+0091 PRIVATE USE 1 PRIVATE USE-1 U+0092 PRIVATE USE 2 PRIVATE USE-2 U+2118 SCRIPT CAPITAL P WEIERSTRASS ELLIPTIC FUNCTION =begin original Perl will accept any of these names as input, but C now returns the new name of each pair. The change for U+2118 is considered by Unicode to be a correction, that is the original name was a mistake (but again, it will remain forever valid to use it to refer to U+2118). But most of these changes are the fallout of the mistake Unicode 6.0 made in naming a character used in Japanese cell phones to be "BELL", which conflicts with the longstanding industry use of (and Unicode's recommendation to use) that name to mean the ASCII control character at U+0007. Therefore, that name has been deprecated in Perl since v5.14, and any use of it will raise a warning message (unless turned off). The name "ALERT" is now the preferred name for this code point, with "BEL" an acceptable short form. The name for the new cell phone character, at code point U+1F514, remains undefined in this version of Perl (hence we don't implement quite all of Unicode 6.1), but starting in v5.18, BELL will mean this character, and not U+0007. =end original Perl は任意の名前を入力として受け付けますが、C は それぞれのペアの新しい名前を返すようになりました。 U+2118 の変更は、元の名前が間違っていたための Unicode による訂正と 考えられます(しかし再び、これは U+2118 を参照するために永遠に有効の ままです)。 しかしこれらの変更の中で最大のものは、日本の携帯電話で使われている 文字の名前に、長い間実用されている (そして Unicode も使用を推奨している ASCII 制御文字 U+0007 と衝突している "BELL" という名前を付けたことによる 副産物です。 従って、この名前は v5.14 以降 Perl では非推奨となっていて、 これを使うと(オフにしていなければ)警告メッセージが発生します。 この符号位置に対する適切な名前は "ALERT" になり、短い形式として "BEL" が受け入れられるようになります。 このバージョンの Perl では、符号位置 U+1F514 の新しい携帯電話の文字の 名前は未定義のままです(従って私たちは Unicode 6.1 の完全に全てを 実装しているわけではありません)が、v5.18 から BELL は U+0007 ではなく この文字を意味するようになります。 =begin original Unicode has taken steps to make sure that this sort of mistake does not happen again. The Standard now includes all generally accepted names and abbreviations for control characters, whereas previously it didn't (though there were recommended names for most of them, which Perl used). This means that most of those recommended names are now officially in the Standard. Unicode did not recommend names for the four code points listed above between U+008E and U+008F, and in standardizing them Unicode subtly changed the names that Perl had previously given them, by replacing the final blank in each name by a hyphen. Unicode also officially accepts names that Perl had deprecated, such as FILE SEPARATOR. Now the only deprecated name is BELL. Finally, Perl now uses the new official names instead of the old (now considered obsolete) names for the first four code points in the list above (the ones which have the parentheses in them). =end original Unicode はこのような過ちが再び起きないようにするための対策を取りました。 今では標準には制御文字に対して、全ての一般的に受け入れられている名前を 含むようになりました(以前は含んでいませんでしたが、そのほとんどは Perl が使っていた推奨される名前でした)。 Unicode は U+008E から U+008F の間の上述の四つの符号位置に対する 名前を推奨しておらず、これらを標準化する際に Unicode は Perl が以前 与えていた名前を、それぞれの名前の最後の空白をハイフンにすることで 微妙に変更しました。 Unicode はまた、FILE SEPARATOR のように Perl では非推奨とした名前を 公式に受け入れました。 今では唯一の非推奨の名前は BELL です。 最終的に、上述の四つの符号位置の名前として古い(今では古いものとなったと 考えられる)名前ではなく、新しい公式の名前(かっこで囲まれたもの)を使います。 =begin original Now that the names have been placed in the Unicode standard, these kinds of changes should not happen again, though corrections, such as to U+2118, are still possible. =end original 名前が Unicode 標準に入ったことにより、この種の変更は再び発生することは ありませんが、U+2118 に対するような修正は引き続き起こりえます。 =begin original Unicode also added some name abbreviations, which Perl now accepts: SP for SPACE; TAB for CHARACTER TABULATION; NEW LINE, END OF LINE, NL, and EOL for LINE FEED; LOCKING-SHIFT ONE for SHIFT OUT; LOCKING-SHIFT ZERO for SHIFT IN; and ZWNBSP for ZERO WIDTH NO-BREAK SPACE. =end original Unicode はまたいくつかの名前の略称を追加し、Perl でも使えるようになりました: SPACE 用に SP; CHARACTER TABULATION 用に TAB; LINE FEED 用に NEW LINE, END OF LINE, NL, EOL; SHIFT OUT 用に LOCKING-SHIFT ONE; SHIFT IN 用に LOCKING-SHIFT ZERO; ZERO WIDTH NO-BREAK SPACE 用に ZWNBSP。 =begin original More details on this version of Unicode are provided in L. =end original このバージョンの Unicode に関するさらなる詳細は L で提供されています。 =head3 C is no longer needed for C<\N{I}> (C<\N{I}> には C は不要に) =begin original When C<\N{I}> is encountered, the C module is now automatically loaded when needed as if the C<:full> and C<:short> options had been specified. See L for more information. =end original C<\N{I}> に遭遇すると、必要なら C<:full> と C<:short> のオプションが 指定されたかのように C モジュールが自動的に読み込まれるように なりました。 さらなる情報については L を参照してください。 =head3 C<\N{...}> can now have Unicode loose name matching (C<\N{...}> は Unicode の緩い名前のマッチングに) =begin original This is described in the C item in L below. =end original これは後述する L の C に記述されています。 =head3 Unicode Symbol Names (Unicode シンボル名) =begin original Perl now has proper support for Unicode in symbol names. It used to be that C<*{$foo}> would ignore the internal UTF8 flag and use the bytes of the underlying representation to look up the symbol. That meant that C<*{"\x{100}"}> and C<*{"\xc4\x80"}> would return the same thing. All these parts of Perl have been fixed to account for Unicode: =end original Perl はシンボル名に対する Unicode 対応を適切に行うようになりました。 今までは C<*{$foo}> は内部 UTF8フラグを無視して、基となっているバイト列を 使います。 =over =item * =begin original Method names (including those passed to C) =end original メソッド名 (C に渡されるものも含みます) =item * =begin original Typeglob names (including names of variables, subroutines, and filehandles) =end original 型グロブ名 (変数、サブルーチン、ファイルハンドルの名前を含みます) =item * =begin original Package names =end original パッケージ名 =item * C =item * =begin original Symbolic dereferencing =end original シンボリックなデリファレンス =item * =begin original Second argument to C and C =end original C と C への第 2 引数 =item * =begin original Return value of C =end original C の返り値 =item * =begin original Subroutine prototypes =end original サブルーチンプロトタイプ =item * =begin original Attributes =end original 属性 =item * =begin original Various warnings and error messages that mention variable names or values, methods, etc. =end original 変数の名前や値、メソッドなどに言及する様々な警告やエラーメッセージ =back =begin original In addition, a parsing bug has been fixed that prevented C<*{é}> from implicitly quoting the name, but instead interpreted it as C<*{+é}>, which would cause a strict violation. =end original さらに、C<*{é}> を暗黙にクォートする名前から除外するバグが修正され、 strict 違反となる C<*{+é}> として解釈されるようになりました。 =begin original C<*{"*a::b"}> automatically strips off the * if it is followed by an ASCII letter. That has been extended to all Unicode identifier characters. =end original C<*{"*a::b"}> は、* の後に ASCII 文字が引き続いている場合は * が自動的に 削除されます。 これは全ての Unicode 識別子文字に拡張されました。 =begin original One-character non-ASCII non-punctuation variables (like C<$é>) are now subject to "Used only once" warnings. They used to be exempt, as they were treated as punctuation variables. =end original (C<$é> のような) 単一文字非 ASCII 非句読点変数はは "Used only once" 警告を出すようになりました。 今までは、これは句読点変数として扱われていたので警告から免れていました。 =begin original Also, single-character Unicode punctuation variables (like C<$‰>) are now supported [perl #69032]. =end original また、(C<$‰> のような)単一文字の Unicode 句読点変数に対応しました [perl #69032]。 =head3 Improved ability to mix locales and Unicode, including UTF-8 locales ((UTF-8 ロケールを含む)ロケールと Unicode を混ぜる能力の改善) =begin original An optional parameter has been added to C =end original C にオプションの引数が追加されました: use locale ':not_characters'; =begin original which tells Perl to use all but the C and C portions of the current locale. Instead, the character set is assumed to be Unicode. This lets locales and Unicode be seamlessly mixed, including the increasingly frequent UTF-8 locales. When using this hybrid form of locales, the C<:locale> layer to the L pragma can be used to interface with the file system, and there are CPAN modules available for ARGV and environment variable conversions. =end original は、現在のロケールのうち、C と C 以外の全てを 使うことを Perl に知らせます。 それ以外では、文字集合は Unicode であると仮定します。 これにより、徐々に頻繁に出てくる UTF-8 ロケールを含む、ロケールと Unicode をシームレスに混ぜることが出来るようになります。 このハイブリッド形式のロケールを使うとき、 L への C<:locale> 層をファイルシステムへのインターフェースとして 使うことができ、ARGV と環境変数の変換のための CPAN モジュールを 利用可能です。 =begin original Full details are in L. =end original 完全な詳細は L にあります。 =head3 New function C and corresponding escape sequence C<\F> for Unicode foldcase (Unicode 畳み込み文字のための新しい関数 C と対応するエスケープシーケンス C<\F>) =begin original Unicode foldcase is an extension to lowercase that gives better results when comparing two strings case-insensitively. It has long been used internally in regular expression C matching. Now it is available explicitly through the new C function call (enabled by S>, or C, or explicitly callable via C) or through the new C<\F> sequence in double-quotish strings. =end original Unicode の畳み込み文字は、二つの文字列を大文字小文字を無視して比較するときに よりよい結果を与えるための小文字の拡張です。 これは長い間正規表現の C マッチングで内部で使われていました。 これは (S>、C で有効にするか、 明示的な C で明示的に呼び出し可能な)新しい C 関数呼び出しか、 ダブルクォート風の文字列の中の新しい C<\F> シーケンスを通して 利用可能になりました。 =begin original Full details are in L. =end original 完全な詳細は L にあります。 =head3 The Unicode C property is now supported. (Unicode の C 特性に対応) =begin original New in Unicode 6.0, this is an improved C