=head1 NAME perldelta - what is new for perl v5.9.4 J<< ja; perldelta - perl v5.9.4 更新情報 >> =head1 DESCRIPTION This document describes differences between the 5.9.3 and the 5.9.4 development releases. See L, L, L and L for the differences between 5.8.0 and 5.9.3. J<< ja; このドキュメントでは開発リリース 5.9.3 と 5.9.4 の間での変更点を 説明します. 5.8.0 から 5.9.3 までの変更点は L, L, L そして L を 参照してください. >> =head1 Incompatible Changes J<< ja; 互換性の無い変更点 >> =head2 chdir FOO A bareword argument to chdir() is now recognized as a file handle. Earlier releases interpreted the bareword as a directory name. (Gisle Aas) J<< ja; chdir() の裸の単語(bareword)引数はファイルハンドルとして 処理されるようになりました. これまでのリリースではbarewordは ディレクトリ名として処理されていました. >> =head2 Handling of pmc files J<< ja; pmc ファイルの処理 >> An old feature of perl was that before C or C look for a file with a F<.pm> extension, they will first look for a similar filename with a F<.pmc> extension. If this file is found, it will be loaded in place of any potentially existing file ending in a F<.pm> extension. J<< ja; perl の古い機能で, C や C が拡張子 F<.pm> をもつ ファイルを探す前に同じファイル名で拡張子 F<.pmc> を持つファイルを 先に探していました. このファイルが見つかった時は F<.pm> 拡張子で 終わるファイルの存在の代わりにロードされます. >> Previously, F<.pmc> files were loaded only if more recent than the matching F<.pm> file. Starting with 5.9.4, they'll be always loaded if they exist. (This trick is used by Pugs.) J<< ja; これまでは, F<.pmc> ファイルは F<.pm> とり新しい場合にだけ ロードされました. 5.9.4 からはそれが存在する時は常にロード されるようになりました. (このトリックは Pugs で使われて います. ) >> =head2 @- and @+ in patterns J<< ja; パターンでの @- 及び @+ >> The special arrays C<@-> and C<@+> are no longer interpolated in regular expressions. (Sadahiro Tomoyuki) J<< ja; 特殊配列 C<@-> 及び C<@+> は正規表現の中に住み着かなくなりました. (Sadahiro Tomoyuki) >> =head2 $AUTOLOAD can now be tainted J<< ja; $AUTOLOAD も taint が作用するようになります >> If you call a subroutine by a tainted name, and if it defers to an AUTOLOAD function, then $AUTOLOAD will be (correctly) tainted. (Rick Delaney) J<< ja; taint されている名前で関数を呼び出して, それが AUTOLOAD 関数を 呼び出したとき, $AUTOLOAD は(正しく) taint されるようになりました. (Rick Delaney) >> =head1 Core Enhancements J<< ja; コアの強化 >> =head2 state() variables J<< ja; state() 変数 >> A new class of variables has been introduced. State variables are similar to C variables, but are declared with the C keyword in place of C. They're visible only in their lexical scope, but their value is persistent: unlike C variables, they're not undefined at scope entry, but retain their previous value. (Rafael Garcia-Suarez) J<< ja; 新しい変数の種類が導入されました. state 変数は C 変数と 似ていますが, C の代わりに C キーワードで宣言されます. これはそのレキシカルスコープでのみ可視になりますが, その値は永続します: C 変数とは異なりスコープに入ったときには 未定義ではなく, 以前の値を復元します. (Rafael Garcia-Suarez) >> To use state variables, one needs to enable them by using J<< ja; state 変数を使うには次のコード >> use feature "state"; or by using the C<-E> command-line switch in one-liners. J<< ja; かワンライナであれば C<-E> コマンドラインスイッチで有効にする 必要があります. >> See L. J<< ja; L を参照してください. >> =head2 UNIVERSAL::DOES() The C class has a new method, C. It has been added to solve semantic problems with the C method. C checks for inheritance, while C has been designed to be overridden when module authors use other types of relations between classes (in addition to inheritance). (chromatic) J<< ja; C クラスに新しいメソッド C が追加されました. これは C メソッドの抱えていた意味的な問題を解決するために 追加されていました. C は継承関係を調べますが, C は モジュールの作者が(継承に加えて)それ以外の種類のクラス間の関係を オーバーライドすることができるように設計されています. (chromatic) >> See L<< UNIVERSAL/"$obj->DOES( ROLE )" >>. J<<<< ja; L<< UNIVERSAL/"$obj->DOES( ROLE )" >> を参照してください. >>>> =head2 Exceptions in constant folding J<< ja; 定数畳み込み時の例外 >> The constant folding routine is now wrapped in an exception handler, and if folding throws an exception (such as attempting to evaluate 0/0), perl now retains the current optree, rather than aborting the whole program. (Nicholas Clark, Dave Mitchell) J<< ja; 定数畳み込みルーチンは例外ハンドラに包まれるようになりました, そしてもし畳み込み時に例外が発生した場合には(0/0 を評価した等), perl プログラム全体をアボートするのではなくその時点の optree を 維持します. (Nicholas Clark, Dave Mitchell) >> =head2 Source filters in @INC J<< ja; @INC でのソースフィルタ >> It's possible to enhance the mechanism of subroutine hooks in @INC by adding a source filter on top of the filehandle opened and returned by the hook. This feature was planned a long time ago, but wasn't quite working until now. See L for details. (Nicholas Clark) J<< ja; ソースフィルタをフックで開かれて返されたファイルハンドルの 先頭に加えることで @INC での関数によるフックメカニズムを 拡張することが可能です. この機能はずいぶん前から計画されて いましたが, これまで全然手をつけられていませんでした. 詳細は L を参照してください. (Nicholas Clark) >> =head2 MAD MAD, which stands for I, is a still-in-development work leading to a Perl 5 to Perl 6 converter. To enable it, it's necessary to pass the argument C<-Dmad> to Configure. The obtained perl isn't binary compatible with a regular perl 5.9.4, and has space and speed penalties; moreover not all regression tests still pass with it. (Larry Wall, Nicholas Clark) J<< ja; MAD, I<いろいろな属性修飾 (Misc Attribute Decoration)>, は Perl 5 から Perl 6 へのコンバータへと至る作業の開発段階に あります. これを有効にするには Configure 引数に C<-Dmad> 引数 を渡す必要があります. これによって作られる perl はふつうに作られた perl 5.9.4 とはバイナリ互換がなく, また, 空間, 速度にペナルティを もちます; さらにはまだ全てのレグレッションテストには通過していま せん. (Larry Wall, Nicholas Clark) >> =head1 Modules and Pragmas J<< ja; モジュールとプラグマ >> =over 4 =item * C is now a lexical pragma. (Although on older perls, which don't have support for lexical pragmas, it keeps its global behaviour.) (Audrey Tang) J<< ja; C はレキシカルプラグマになりました. (しかしレキシカルプラグマをサポートしていない古い perl では グローバルな振る舞いのままです.) (Audrey Tang) >> =item * C is now a dual-life module, also available on CPAN. It has been expanded in many ways. A kill() method is available for thread signalling. One can get thread status, or the list of running or joinable threads. J<< ja; C はデュアルライフなモジュールになり, CPAN からも 提供されるようになりました. これはいくつかの方法で拡張されて います. スレッドに対してシグナルを送る kill() メソッドが提供 されるようになりました. スレッドのステータスや実行されている, 若しくは join 可能なスレッドの一覧を取得できるようになりました. >> A new C<< threads->exit() >> method is used to exit from the application (this is the default for the main thread) or from the current thread only (this is the default for all other threads). On the other hand, the exit() built-in now always causes the whole application to terminate. (Jerry D. Hedden) J<< ja; 新しい C<< threads->exit() >> メソッドはアプリケーションから exit するためや(これは main スレッドのデフォルトです), 現在のスレッド のみから exit するため(これはそれ以外のスレッドのデフォルトです)に 使うことができます. 言い換えると, exit() 組み込み関数は常に アプリケーション全体を終了させます. (Jerry D. Hedden) >> =back =head2 New Core Modules J<< ja; 新しいコアモジュール >> =over 4 =item * C, by Anno Siegel, has been added. This module provides support for I: hashes that maintain an association of a reference with a value, in a thread-safe garbage-collected way. J<< ja; Anno Siegel による C が追加されました. このモジュールは I のサポートを提供します: これはスレッドセーフでガーベジコレクトされる形で, リファレンスの値との関係を保持します. >> =item * C, by Ken Williams, has been added. It's an alternative to C to build and install perl modules. J<< ja; Ken Williams による C が追加されました. これは perl モジュールをビルド及びインストールするための C の代替です. >> =item * C, by Jos Boumans, has been added. It provides a single interface to load Perl modules and F<.pl> files. J<< ja; Jos Boumans による C が追加されました. これは Perl モジュールと F<.pl> ファイルをロードする単一のインターフェース を提供します. >> =item * C, by Jos Boumans, has been added. It's used to mark modules as loaded or unloaded. J<< ja; Jos Boumans による C が追加されました. これは モジュールがロードされているかいないかを調べるのに役立ちます. >> =item * C, by Jos Boumans, has been added. It's a simple helper to list all constants declared in a given package. J<< ja; Jos Boumans による C が追加されました. これは指定されたパッケージで宣言されている全ての定数をリストアップ する簡単なヘルパーです. >> =item * C, by Tye McQueen, has been added (for Windows builds). This module provides low-level access to Win32 system API calls for files/dirs. J<< ja; McQueen による C が(Windows ビルドに)追加されました. このモジュールはファイル/ディレクトリに対する Win32 システム API 呼び出しへの低レベルなアクセスを提供します. >> =back =head1 Utility Changes J<< ja; ユーティリティの変更点 >> =head2 config_data C is a new utility that comes with C. It provides a command-line interface to the configuration of Perl modules that use Module::Build's framework of configurability (that is, C<*::ConfigData> modules that contain local configuration information for their parent modules.) J<< ja; C から C ユーティリティが新しく 加わりました. これは configure 可能な Module::Build のフレーム ワークを使っている Perl モジュール(つまり, 親モジュールに対する ローカルな設定情報を含んでいる C<*::ConfigData> モジュール)の 設定をするためのコマンドラインインターフェースを提供します. >> =head1 Documentation J<< ja; ドキュメント >> =head2 New manpage, perlpragma J<< ja; 新しいマニュアルページ, perlpragma >> The L manpage documents how to write one's own lexical pragmas in pure Perl (something that is possible starting with 5.9.4). J<< ja; L マニュアルページは自分のレキシカルなプラグマを pure Perl でどうやって書くかを説明しています(5.9.4 から可能です). >> =head2 New manpage, perlreguts J<< ja; 新しいマニュアルページ, perlreguts >> The L manpage, courtesy of Yves Orton, describes internals of the Perl regular expression engine. J<< ja; L マニュアルページ, Yves Orton の作法, は Perl 正規表現エンジンの内部を説明しています. >> =head2 New manpage, perlunitut J<< ja; 新しいマニュアルページ, perlunitut >> The L manpage is an tutorial for programming with Unicode and string encodings in Perl, courtesy of Juerd Waalboer. J<< ja; L マニュアルページは Perl での Unicode 及び 文字列縁故ーでゅイングを使ったプログラム方法のチュートリアルで, Juerd Waalboer の作法です. >> =head1 Performance Enhancements J<< ja; パフォーマンス強化 >> =head2 Memory optimisations J<< ja; メモリの最適化 >> Several internal data structures (typeglobs, GVs, CVs, formats) have been restructured to use less memory. (Nicholas Clark) J<< ja; いくつかの内部データ構造 (typeglobs, GV, CV, format)は よりメモリ消費の少ない構造に再設計されました. (Nicholas Clark) >> =head2 UTF-8 cache optimisation J<< ja; UTF-8 キャッシュの最適化 >> The UTF-8 caching code is now more efficient, and used more often. (Nicholas Clark) J<< ja; UTF-8 キャッシュコードはより効率的に, そしてより多く 使われるようになりました. (Nicholas Clark) >> =head2 Regular expressions J<< ja; 正規表現 >> =over 4 =item Engine de-recursivised J<< ja; 再帰展開エンジン >> The regular expression engine is no longer recursive, meaning that patterns that used to overflow the stack will either die with useful explanations, or run to completion, which, since they were able to blow the stack before, will likely take a very long time to happen. If you were experiencing the occasional stack overflow (or segfault) and upgrade to discover that now perl apparently hangs instead, look for a degenerate regex. (Dave Mitchell) J<< ja; 正規表現エンジンは再帰しなくなりました, これはスタックを あふれさせるようなパターンはわかりやすい説明を出して die するか, スタックを前もって吹き飛ばすことができても終了までにとても 長い時間がかかります. もし不定期なスタックオーバーフロー(もしくは segfault)が起こるのであればハングする代わりに生成を分離した 正規表現を見つける perl を見つけ出すためにアップグレードして ください. >> =item Single char char-classes treated as literals J<< ja; 1文字の文字クラスはリテラルとして扱わるようになります >> Classes of a single character are now treated the same as if the character had been used as a literal, meaning that code that uses char-classes as an escaping mechanism will see a speedup. (Yves Orton) J<< ja; 1文字からなるクラスはリテラルとして使われている文字と同一に 扱われるようになりました, これは文字クラスをエスケープとして使っている コードのスピードアップを意味します. (Yves Orton) >> =item Trie optimisation of literal string alternations J<< ja; リテラル文字列選択のトライ(Trie)最適化 >> Alternations, where possible, are optimised into more efficient matching structures. String literal alternations are merged into a trie and are matched simultaneously. This means that instead of O(N) time for matching N alternations at a given point the new code performs in O(1) time. (Yves Orton) J<< ja; 選択(Alternations; "|")は, 可能であればより効率的なマッチング 構造へと最適化されるようになりました. 文字列リテラルの選択は トライへとマージされ, 同時にマッチが行われるようになります. これはある場所で N 個の選択マッチがあった場合に O(N) ではなく 新しいコードでは O(1) で処理されるようになります. (Yves Orton) >> B Much code exists that works around perl's historic poor performance on alternations. Often the tricks used to do so will disable the new optimisations. Hopefully the utility modules used for this purpose will be educated about these new optimisations by the time 5.10 is released. J<< ja; B<捕捉:> perl の歴史的な貧弱な選択パフォーマンスに関連する多くの コードが残っています. それの為にしばしば使われているトリックは 新しい最適化では無効になります. 幸運にもこの目的で使われている ユーティリティモジュールは 5.10 がリリースされるまでこの 新しい最適化についての教育を受けるでしょう. >> =item Aho-Corasick start-point optimisation J<< ja; Aho-Corasick 法による開始位置の最適化 >> When a pattern starts with a trie-able alternation and there aren't better optimisations available the regex engine will use Aho-Corasick matching to find the start point. (Yves Orton) J<< ja; パターンがトライ化可能な選択で始まっていてよりよい最適化が なかった場合に正規表現エンジンは開始位置を探すために Aho-Corasick マッチを使います. (Yves Orton) >> =back =head2 Sloppy stat on Windows J<< ja; Windows によるルーズな stat >> On Windows, perl's stat() function normally opens the file to determine the link count and update attributes that may have been changed through hard links. Setting ${^WIN32_SLOPPY_STAT} to a true value speeds up stat() by not performing this operation. (Jan Dubois) J<< ja; Windows において, perl の stat() 関数は通常リンク回数を 決定してハードリンクを通して変更されたかもしれない属性を更新するために ファイルを開きます. ${^WIN32_SLOPPY_STAT} に真を設定すると この処理を行わなくなり stat() の速度が向上します. >> =head1 Installation and Configuration Improvements J<< ja; インストールと Configure の向上 >> =head2 Relocatable installations J<< ja; 再配置可能なインストール >> There is now Configure support for creating a relocatable perl tree. If you Configure with C<-Duserelocatableinc>, then the paths in @INC (and everything else in %Config) can be optionally located via the path of the perl executable. J<< ja; 新しい Configure で再配置可能な perl ツリーの生成がサポート されました. Configure に C<-Duserelocatableinc> を指定することで @INC (及び %Config にあるそれ以外の全て)は perl 実行形式の パスからその位置を選択可能になりました. >> That means that, if the string C<".../"> is found at the start of any path, it's substituted with the directory of $^X. So, the relocation can be configured on a per-directory basis, although the default with C<-Duserelocatableinc> is that everything is relocated. The initial install is done to the original configured prefix. J<< ja; これはパスの始まりに文字列 C<".../"> が見つかると, それは $^X の ディレクトリで置き換えられるということです. これによって, C<-Duserelocatableinc> によるデフォルトでは全てが再配置されますが, 再配置はディレクトリベースで行われます. 最初のインストールは最初に configure で行った prefix へと行われます. >> =head2 Ports J<< ja; プラットフォーム別 >> Many improvements have been made towards making Perl work correctly on z/OS. J<< ja; z/OS で正しく動作する Perl を作るために多くの向上が行われ ました. >> Perl has been reported to work on DragonFlyBSD. J<< ja; Perl は DragonFlyBSD での動作が報告されました. >> =head2 Compilation improvements J<< ja; コンパイルの向上 >> All F files in the XS modules bundled with perl are now autogenerated at build time. (Marcus Holland-Moritz) J<< ja; perl とバンドルされている XS モジュールにある全ての F ファイルはビルド時に生成されるようになりました. (Marcus Holland-Moritz) >> =head2 New probes J<< ja; 新しいチェック >> The configuration process now detects whether strlcat() and strlcpy() are available. When they are not available, perl's own version is used (from Russ Allbery's public domain implementation). Various places in the perl interpreter now use them. (Steve Peters) J<< ja; configure プロセスで strlcat() 及び strlcpy() が提供されているか を検出するようになりました. これらが提供されていなかった場合には perl の独自版が使われます(Russ Allbery によるパブリックドメイン実装). perl インタプリタの様々な場所でこれらを使うようになりました. (Steve Peters) >> =head2 Windows build improvements J<< ja; Windows ビルドの向上 >> =over 4 =item Building XS extensions J<< ja; XS 拡張のビルド >> Support for building XS extension modules with the free MinGW compiler has been improved in the case where perl itself was built with the Microsoft VC++ compiler. (ActiveState) J<< ja; Perl 自身が Microsoft VC++ コンパイラでビルドされていた場合の MinGW コンパイラによる XS 拡張モジュールのビルドサポートが向上されました. (ActiveState) >> =item Support for 64-bit compiler J<< ja; 64-bit コンパイラのサポート >> Support for building perl with Microsoft's 64-bit compiler has been improved. (ActiveState) J<< ja; Microsoft の 64-bit コンパイラでのビルドのサポートが 向上しました. (ActiveState) >> =back =head1 Selected Bug Fixes J<< ja; バグ修正抜粋 >> =head2 PERL5SHELL and tainting J<< ja; PERL5SHELL と taint >> On Windows, the PERL5SHELL environment variable is now checked for taintedness. (Rafael Garcia-Suarez) J<< ja; Windows において, PERL5SHELL 環境変数は taint 性を確認されるように なりました. (Rafael Garcia-Suarez) >> =head2 Using *FILE{IO} J<< ja; *FILE{IO} の使用 >> C and C<-X> filetests now treat *FILE{IO} filehandles like *FILE filehandles. (Steve Peters) J<< ja; C 及び C<-X> ファイルテストは *FILE ファイルハンドルの ように *FILE{IO} ファイルハンドルを扱うようになりました. >> =head2 Overloading and reblessing J<< ja; オーバーロードと再bless >> Overloading now works when references are reblessed into another class. Internally, this has been implemented by moving the flag for "overloading" from the reference to the referent, which logically is where it should always have been. (Nicholas Clark) J<< ja; リファレンスが他のクラスへと再blessされてもオーバーロードは 動作するようになりました. 内部的にはこれは"オーバーロードされている" というフラグがリファレンスから論理的に常に存在しているべき場所である その参照先へと移動することで実装されています. (Nicholas Clark) >> =head2 Overloading and UTF-8 J<< ja; オーバーロードと UTF-8 >> A few bugs related to UTF-8 handling with objects that have stringification overloaded have been fixed. (Nicholas Clark) J<< ja; 文字列化をオーバーロードしているオブジェクトでの UTF-8 処理に 関連したいくつかのバグが修正されました. (Nicholas Clark) >> =head2 eval memory leaks fixed J<< ja; eval メモリリークの修正 >> Traditionally, C has leaked badly. Many (but not all) of these leaks have now been eliminated or reduced. (Dave Mitchell) J<< ja; 以前より, C は悪いことにリークを起こしていました. いくつかの(けど全てではない)これらのリークは削除若しくは削減されました. (Dave Mitchell) >> =head2 Random device on Windows J<< ja; Windows でのランダムデバイス >> In previous versions, perl would read the file F if it existed when seeding its random number generator. That file is unlikely to exist on Windows, and if it did would probably not contain appropriate data, so perl no longer tries to read it on Windows. (Alex Davies) J<< ja; これまでのバージョンではランダム生成の種を作るときに F が存在すればそこから読んでいました. このファイルが Windows で 間の悪いことに存在していても適切なデータを持っていないため, Windows ではこのファイルからは読まないようになりました. (Alex Davies) >> =head1 New or Changed Diagnostics J<< ja; 新しい及び変更された診断メッセージ >> =over 4 =item State variable %s will be reinitialized One can assign initial values to state variables, but not when they're declared as a sub-part of a list assignment. See L. J<< ja; 『state変数 %s は再初期化されます』 state 変数に初期値を割り当てることはできますが, それはリスト代入の 一部として宣言されていないときです. L を参照してください. >> =back =head1 Changed Internals J<< ja; 変更された内部処理 >> A new file, F, contains functions that aren't used anymore in the perl core, but remain around because modules out there might still use them. They come from a factorization effort: for example, many PP functions are now shared for several ops. J<< ja; 新しいファイル, F には perl コアではもう使われていない 関数を含んでいます, これらは他のモジュールで使っているかもしれないため 保持はしています. これらは因数分解の努力からきています: 例えば多くの PP 関数はいくつかの ops で共有されています. >> The implementation of the special variables $^H and %^H has changed, to allow implementing lexical pragmas in pure perl. J<< ja; 特殊変数 $^H 及び %^H の実装は pure perl でレキシカル プラグマを実装できるようにするために変更されました. >> =head1 Known Problems J<< ja; 既知の問題 >> One warning test (number 263 in F) fails under UTF-8 locales. J<< ja; 警告テストの1つ (F の 263 番)は UTF-8 ロケール で失敗します. >> Bytecode tests fail under several platforms. We are considering removing support for byteloader and compiler before the 5.10.0 release. J<< ja; いくつかのプラットフォームで Bytecode テストは失敗します. 私たちは 5.10.0 のリリースの前に byteloader と compiler の サポートを外すことを考えています. >> =head1 Reporting Bugs J<< ja; バグの報告方法 >> If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/rt3/ . There may also be information at http://www.perl.org/ , the Perl Home Page. J<< ja; もしバグと思われるものが見つかったら, comp.lang.perl.misc ニュース グループに最近投稿された記事や http://rt.perl.org/rt3/ にある perl バグデータベースを確認してください. Perl ホームページ, http://www.perl.org にも情報はあります. >> If you believe you have an unreported bug, please run the B program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of C, will be sent off to perlbug@perl.org to be analysed by the Perl porting team. J<< ja; もしまだ報告されていないバグだと確信したら, そのリリースに含まれている B プログラムをを実行してください. バグの再現スクリプトを 十分小さく, しかし有効なコードに切りつめることを意識してください. バグレポートは C の出力と一緒に perlbug@perl.org に送られ Perl porting チームによって解析されます. >> =head1 SEE ALSO The F file for exhaustive details on what changed. J<< ja; F には完全な変更箇所があります. >> The F file for how to build Perl. J<< ja; F には Perl をビルドする方法があります. >> The F file for general stuff. J<< ja; F には一般的な事項があります. >> The F and F files for copyright information. J<< ja; F 及び F には著作権情報があります. >> =head1 TRANSALTE TO JAPANESE J<< ja;和訳 >> 山科 氷魚 (YAMASHINA Hio) Origlnal distribution is perl VERSION 5.9.4. Translated at 2007-03-21. J<< ja; 原典: perl VERSION 5.9.4. 翻訳日: 2007-03-21. >> =cut