=encoding euc-jp =head1 NAME =begin original perlport - Writing portable Perl =end original perlport - 移植性のある Perl を書く =head1 DESCRIPTION =begin original Perl runs on numerous operating systems. While most of them share much in common, they also have their own unique features. =end original Perl は多くのオペレーティングシステム上で動作します。 これらのほとんどは一般的にかなりの部分を共有していますが、それぞれ固有の 機能も持っています。 =begin original This document is meant to help you to find out what constitutes portable Perl code. That way once you make a decision to write portably, you know where the lines are drawn, and you can stay within them. =end original この文書は移植性のある Perl コードの構成要素を発見する助けになるための ものです。 移植性のある形で書こうと決心したら、どこに線が引かれているかを知ることで、 その内側に留まることができます。 =begin original There is a tradeoff between taking full advantage of one particular type of computer and taking advantage of a full range of them. Naturally, as you broaden your range and become more diverse, the common factors drop, and you are left with an increasingly smaller area of common ground in which you can operate to accomplish a particular task. Thus, when you begin attacking a problem, it is important to consider under which part of the tradeoff curve you want to operate. Specifically, you must decide whether it is important that the task that you are coding has the full generality of being portable, or whether to just get the job done right now. This is the hardest choice to be made. The rest is easy, because Perl provides many choices, whichever way you want to approach your problem. =end original ある特定の種類のコンピュータの利点を使うことと、あらゆる範囲の コンピュータの利点を使うことの間にはトレードオフがあります。 当然ながら、より範囲を広げてより多様性のある形にすると、共通の要素が 減っていき、特定のタスクを達成するために操作できる共通の地盤が徐々に 小さくなっていきます。 従って、問題に取りかかるときに、トレードオフのカーブのどの部分を 使うかを考えることは重要です。 特に、コーディングしようとするタスクが移植性に関して完全な一般性が 重要かどうか、またすぐにジョブを終わらせるかどうかを 決定しなければなりません。 残りのことは簡単です。 なぜならあなたが問題にどのようにアプローチしたいとしても Perl は多くの 選択肢を提供するからです。 =begin original Looking at it another way, writing portable code is usually about willfully limiting your available choices. Naturally, it takes discipline and sacrifice to do that. The product of portability and convenience may be a constant. You have been warned. =end original これを他の方法で見てみると、移植性のあるコードを書くことは通常あなたが 取り得る選択肢を故意に制限します。 当然ながら、これは規律と犠牲が伴います。 おそらく移植性と利便性の積は一定です。 あなたは警告されましたよ。 =begin original Be aware of two important points: =end original 二つの重要な点に注意してください: =over 4 =item Not all Perl programs have to be portable (全ての Perl プログラムが移植性がある必要はありません) =begin original There is no reason you should not use Perl as a language to glue Unix tools together, or to prototype a Macintosh application, or to manage the Windows registry. If it makes no sense to aim for portability for one reason or another in a given program, then don't bother. =end original Unix ツールを互いにくっつけたり、Macintosh アプリケーションのプロトタイプを 作ったり、Windows レジストリを操作するための言語として Perl を 使うべきではないという理由はありません。 プログラムにとって何らかの理由で移植性を目標とすることが無意味なら、 気にしないでください。 =item Nearly all of Perl already I portable (ほとんど全ての Perl は既に移植性が I<あります>) =begin original Don't be fooled into thinking that it is hard to create portable Perl code. It isn't. Perl tries its level-best to bridge the gaps between what's available on different platforms, and all the means available to use those features. Thus almost all Perl code runs on any machine without modification. But there are some significant issues in writing portable code, and this document is entirely about those issues. =end original 移植性のある Perl コードを作るのが難しいという考えに騙されないでください。 そうではありません。 Perl は、異なったプラットフォームで何が利用可能かとこの機能を使うために 利用可能なもの全てとの間のずれを出来るだけ橋渡ししようとします。 従って、ほとんど全ての Perl コードは修正なしにどのマシンでも動作します。 しかし移植性のあるコードを書くにはいくつかの重要な問題があり、この文書は 全体的にそのような問題を扱っています。 =back =begin original Here's the general rule: When you approach a task commonly done using a whole range of platforms, think about writing portable code. That way, you don't sacrifice much by way of the implementation choices you can avail yourself of, and at the same time you can give your users lots of platform choices. On the other hand, when you have to take advantage of some unique feature of a particular platform, as is often the case with systems programming (whether for Unix, Windows, VMS, etc.), consider writing platform-specific code. =end original 一般的なルールを挙げます: プラットフォーム全体で使われて一般的に 処理されるようなタスクに迫るとき、移植性のあるコードを書くことを 考えてください。 その方向で、自分自身の実装の選択肢を多く犠牲にすることはなく、 同時にユーザーに多くのプラットフォームの選択肢を与えることができます。 一方、特定のプラットフォームで固有の機能の利点を使う必要がある場合、 例えば (Unix, Windows, VMS など専用の) システムプログラムのような 場合、プラットフォーム固有のコードを書くことを考えてください。 =begin original When the code will run on only two or three operating systems, you may need to consider only the differences of those particular systems. The important thing is to decide where the code will run and to be deliberate in your decision. =end original コードが二つか三つのオペレーティングシステムでだけ動作するときは、 それらの特定のシステムでの違いのみを考慮する必要があります。 重要なことは、どこでコードを実行するかと、決定を熟考することです。 =begin original The material below is separated into three main sections: main issues of portability (L<"ISSUES">), platform-specific issues (L<"PLATFORMS">), and built-in Perl functions that behave differently on various ports (L<"FUNCTION IMPLEMENTATIONS">). =end original 以下の材料は三つの主な章に分割されています: 主な移植性の問題 (L<"ISSUES">)、プラットフォーム固有の問題 (L<"PLATFORMS">)、 OS によって異なった振る舞いをする Perl 組み込み関数 (L<"FUNCTION IMPLEMENTATIONS">) です。 =begin original This information should not be considered complete; it includes possibly transient information about idiosyncrasies of some of the ports, almost all of which are in a state of constant evolution. Thus, this material should be considered a perpetual work in progress (C<< Under Construction >>). =end original この情報は完全であると考えるべきではありません; これは一部の OS に対する 特異性に関するおそらく一時的な情報を含んでいて、それらのほとんどは常に 進化しているものです。 従って、この材料は永遠に作業中であると考えるべきです (C<< Under Construction >>)。 =head1 ISSUES (問題) =head2 Newlines (改行) =begin original In most operating systems, lines in files are terminated by newlines. Just what is used as a newline may vary from OS to OS. Unix traditionally uses C<\012>, one type of DOSish I/O uses C<\015\012>, S uses C<\015>, and z/OS uses C<\025>. =end original ほとんどのオペレーティングシステムで、ファイルの行は改行で終端されます。 単に改行として何を使うかが OS によって異なります。 Unix は伝統的に C<\012> を使い、DOS 風の I/O は C<\015\012> を使い、 S は C<\015> を使い、z/OS は C<\025> を使います。 =begin original Perl uses C<\n> to represent the "logical" newline, where what is logical may depend on the platform in use. In MacPerl, C<\n> always means C<\015>. On EBCDIC platforms, C<\n> could be C<\025> or C<\045>. In DOSish perls, C<\n> usually means C<\012>, but when accessing a file in "text" mode, perl uses the C<:crlf> layer that translates it to (or from) C<\015\012>, depending on whether you're reading or writing. Unix does the same thing on ttys in canonical mode. C<\015\012> is commonly referred to as CRLF. =end original Perl は「論理的な」改行を表現するのに C<\n> を使います; 何が論理的かは 使っているプラットフォームに依存しています。 MacPerl では C<\n> は常に C<\015> を意味します。 EBCDIC プラットフォームでは、C<\n> は C<\025> または C<\045> です。 DOS 風の perl では、C<\n> は普通 C<\012> を意味しますが、ファイルを 「テキスト」モードでアクセスすると、perl は C<\015\012> との間で 変換する C<:crlf> を使います。 Unix はカノニカルモードの tty で同じことをします。 C<\015\012> は一般的には CRLF として参照されます。 =begin original To trim trailing newlines from text lines use C. With default settings that function looks for a trailing C<\n> character and thus trims in a portable way. =end original テキスト行から末尾の改行を切り落とすには、C を使います。 この関数のデフォルト設定は末尾の C<\n> 文字を探すので、移植性のある形で 切り落とします。 =begin original When dealing with binary files (or text files in binary mode) be sure to explicitly set $/ to the appropriate value for your file format before using C. =end original バイナリファイル (またはバイナリモードでのテキストファイル) を扱うときには、 C を使う前にファイル形式に適切な値を $/ に明示的に設定してください。 =begin original Because of the "text" mode translation, DOSish perls have limitations in using C and C on a file accessed in "text" mode. Stick to C-ing to locations you got from C (and no others), and you are usually free to use C and C even in "text" mode. Using C or C or other file operations may be non-portable. If you use C on a file, however, you can usually C and C with arbitrary values safely. =end original 「テキスト」モード変換によって、DOS 的な perl は「テキスト」モードで アクセスするファイルに対する C と C の使用に制限があります。 C で得た位置へ C する(そして他の方法を使わない)ことに 専念することで、「テキスト」モードでも自由に C と C を 使えます。 C や C やその他のファイル操作は互換性がないかもしれません。 しかし、ファイルに対して C を使うと、普通は任意の値を C と C に使っても安全です。 =begin original A common misconception in socket programming is that S> everywhere. When using protocols such as common Internet protocols, C<\012> and C<\015> are called for specifically, and the values of the logical C<\n> and C<\r> (carriage return) are not reliable. =end original ソケットプログラミングでのよくある誤解は、どこでも S> であると いうものです。 一般的なインターネットプロトコルのようなプロトコルを使うとき、 C<\012> と C<\015> は明確に記述されていて、論理的な C<\n> と C<\r> (復帰) の値は信頼できません。 print SOCKET "Hi there, client!\r\n"; # WRONG print SOCKET "Hi there, client!\015\012"; # RIGHT =begin original However, using C<\015\012> (or C<\cM\cJ>, or C<\x0D\x0A>) can be tedious and unsightly, as well as confusing to those maintaining the code. As such, the C module supplies the Right Thing for those who want it. =end original しかし、C<\015\012> (または C<\cM\cJ> または C<\x0D\x0A>) を使うのは 退屈で見苦しいかもしれませんし、コードの保守に混乱するかもしれません。 そのようなものとして、C モジュールは求められていることに対する 正しいものを供給します。 use Socket qw(:DEFAULT :crlf); print SOCKET "Hi there, client!$CRLF" # RIGHT =begin original When reading from a socket, remember that the default input record separator C<$/> is C<\n>, but robust socket code will recognize as either C<\012> or C<\015\012> as end of line: =end original ソケットから読み込むとき、デフォルト入力レコード区切り C<$/> は C<\n> だけれども、堅牢なソケットコードは C<\012> と C<\015\012> の どちらも行の末尾として認識することを忘れないでください: while () { # NOT ADVISABLE! # ... } =begin original Because both CRLF and LF end in LF, the input record separator can be set to LF and any CR stripped later. Better to write: =end original CRLF と LF は両方とも LF で終わっているので、入力レコード区切りを LF に設定して、後から CR を削除できます。 よりよく書くと: use Socket qw(:DEFAULT :crlf); local($/) = LF; # not needed if $/ is already \012 while () { s/$CR?$LF/\n/; # not sure if socket uses LF or CRLF, OK # s/\015?\012/\n/; # same thing } =begin original This example is preferred over the previous one--even for Unix platforms--because now any C<\015>'s (C<\cM>'s) are stripped out (and there was much rejoicing). =end original この例は -- 例え Unix プラットフォームでも -- 以前のものよりよいものです; なぜなら全ての C<\015> (C<\cM>) が削除される(そしてこれはとても喜ばしい) からです。 =begin original Similarly, functions that return text data--such as a function that fetches a web page--should sometimes translate newlines before returning the data, if they've not yet been translated to the local newline representation. A single line of code will often suffice: =end original 同様に、-- web ページを取得する関数のような -- テキストデータを返す関数は、 まだローカルな改行表現に変換されていないなら、データを返す前に改行を 変換するべき場合もあります。 しばしば 1 行のコードで十分です: $data =~ s/\015?\012/\n/g; return $data; =begin original Some of this may be confusing. Here's a handy reference to the ASCII CR and LF characters. You can print it out and stick it in your wallet. =end original これらには混乱があるかもしれません。 以下は ASCII CR と LF 文字の便利なリファレンスです。 これを印刷して財布に貼ることができます。 LF eq \012 eq \x0A eq \cJ eq chr(10) eq ASCII 10 CR eq \015 eq \x0D eq \cM eq chr(13) eq ASCII 13 | Unix | DOS | Mac | --------------------------- \n | LF | LF | CR | \r | CR | CR | LF | \n * | LF | CRLF | CR | \r * | CR | CR | LF | --------------------------- * text-mode STDIO =begin original The Unix column assumes that you are not accessing a serial line (like a tty) in canonical mode. If you are, then CR on input becomes "\n", and "\n" on output becomes CRLF. =end original Unix の列は、カノニカルモードで(tty のような)シリアルインターフェースに アクセスしているのではないことを仮定しています。 もしそうなら、入力の CR は "\n" になり、出力の "\n" は CRLF になります。 =begin original These are just the most common definitions of C<\n> and C<\r> in Perl. There may well be others. For example, on an EBCDIC implementation such as z/OS (OS/390) or OS/400 (using the ILE, the PASE is ASCII-based) the above material is similar to "Unix" but the code numbers change: =end original これらは単に Perl でのもっとも一般的な C<\n> と C<\r> の定義です。 他のものもあり得ます。 例えば、z/OS (OS/390) や OS/400 (ILE を使っている場合; PASE は ASCII ベース) のような EBCDIC 実装では、上述の資料は "Unix" と同様ですが、 コード番号が変更されます: LF eq \025 eq \x15 eq \cU eq chr(21) eq CP-1047 21 LF eq \045 eq \x25 eq chr(37) eq CP-0037 37 CR eq \015 eq \x0D eq \cM eq chr(13) eq CP-1047 13 CR eq \015 eq \x0D eq \cM eq chr(13) eq CP-0037 13 | z/OS | OS/400 | ---------------------- \n | LF | LF | \r | CR | CR | \n * | LF | LF | \r * | CR | CR | ---------------------- * text-mode STDIO =head2 Numbers endianness and Width (数値のエンディアンと幅) =begin original Different CPUs store integers and floating point numbers in different orders (called I) and widths (32-bit and 64-bit being the most common today). This affects your programs when they attempt to transfer numbers in binary format from one CPU architecture to another, usually either "live" via network connection, or by storing the numbers to secondary storage such as a disk file or tape. =end original CPU が異なると、整数と浮動小数点数の順序 (I<エンディアン> (endianness) と 呼ばれます) と幅 (最近ではほとんど 32 ビットと 64 ビットです) が異なります。 これは、ある CPU アーキテクチャから他のものへ数値をバイナリ形式で、 普通はネットワーク接続経由で「ライブ」で、またはディスクファイルや テープのような二次ストレージに保管することで移そうとしたときに 影響します。 =begin original Conflicting storage orders make an utter mess out of the numbers. If a little-endian host (Intel, VAX) stores 0x12345678 (305419896 in decimal), a big-endian host (Motorola, Sparc, PA) reads it as 0x78563412 (2018915346 in decimal). Alpha and MIPS can be either: Digital/Compaq used/uses them in little-endian mode; SGI/Cray uses them in big-endian mode. To avoid this problem in network (socket) connections use the C and C formats C and C, the "network" orders. These are guaranteed to be portable. =end original 保管の順序が衝突すると値が完全におかしくなります。 リトルエンディアンのホスト (Intel, VAX) が 0x12345678 (10 進数では 305419896) を保管すると、ビッグエンディアンのホスト (Motorola, Sparc, PA) は これを 0x78563412 (10 進数では 2018915346) として読み込みます。 Alpha と MIPS はどちらもあり得ます: Digital/Compaq はこれを リトルエンティアンモードで使います; SGI/Cray はこれを ビッグエンディアンモードで使います。 ネットワーク(ソケット)接続でこの問題を避けるには、C と C の 「ネットワーク」順序フォーマットである C および C を使ってください。 これらは移植性があることを保証します。 =begin original As of Perl 5.10.0, you can also use the C> and C> modifiers to force big- or little-endian byte-order. This is useful if you want to store signed integers or 64-bit integers, for example. =end original Perl 5.10.0 から、ビッグエンディアンとリトルエンディアンにバイト順を 強制するための C> と C> の修飾子も使えます。 これは例えば、符号付き整数や 64 ビット整数を保管したいときに有用です。 =begin original You can explore the endianness of your platform by unpacking a data structure packed in native format such as: =end original 次のように、ネイティブな形式で pack されたデータ構造を unpack することで プラットフォームのエンディアンを調べることができます: print unpack("h*", pack("s2", 1, 2)), "\n"; # '10002000' on e.g. Intel x86 or Alpha 21064 in little-endian mode # '00100020' on e.g. Motorola 68040 =begin original If you need to distinguish between endian architectures you could use either of the variables set like so: =end original エンディアンアーキテクチャを区別する必要があるなら、以下のような変数の どちらかを使えます: $is_big_endian = unpack("h*", pack("s", 1)) =~ /01/; $is_little_endian = unpack("h*", pack("s", 1)) =~ /^1/; =begin original Differing widths can cause truncation even between platforms of equal endianness. The platform of shorter width loses the upper parts of the number. There is no good solution for this problem except to avoid transferring or storing raw binary numbers. =end original 幅の違いは同じエンディアンのプラットフォームの間でも切り詰めを 引き起こすことがあります。 幅がより短い側のプラットフォームは数値の上位部分を失います。 生のバイナリ数値を転送したり保管したりしないようにする以外に、この問題への よい解決法はありません。 =begin original One can circumnavigate both these problems in two ways. Either transfer and store numbers always in text format, instead of raw binary, or else consider using modules like C and C (included as of Perl 5.8). Keeping all data as text significantly simplifies matters. =end original これらの問題は二つの方法で避けることが出来ます。 数値を常に生のバイナリではなくテキスト形式で転送して保管するか、(Perl 5.8 から含まれている) C や C のようなモジュールを 使うことを考慮します。 全てのデータをテキストで扱うことは問題をかなり単純化します。 =head2 Files and Filesystems (ファイルとファイルシステム) =begin original Most platforms these days structure files in a hierarchical fashion. So, it is reasonably safe to assume that all platforms support the notion of a "path" to uniquely identify a file on the system. How that path is really written, though, differs considerably. =end original 最近のほとんどのプラットフォームではファイルの構造は階層的です。 従って、全てのプラットフォームがシステム中のファイルをユニークに 識別するための「パス」記法に対応していると仮定することは合理的に安全です。 パスが実際にどのように書かれるかはかなり異なります。 =begin original Although similar, file path specifications differ between Unix, Windows, S, OS/2, VMS, VOS, S, and probably others. Unix, for example, is one of the few OSes that has the elegant idea of a single root directory. =end original 似てはいるものの、ファイルパスの指定方法は Unix, Windows, S, OS/2, VMS, VOS, S そしておそらくその他で 異なります。 例えば、Unix は一つのルートディレクトリというエレガントな考え方を持つ 数少ない OS の一つです。 =begin original DOS, OS/2, VMS, VOS, and Windows can work similarly to Unix with C as path separator, or in their own idiosyncratic ways (such as having several root directories and various "unrooted" device files such NIL: and LPT:). =end original DOS, OS/2, VMS, VOS, Windows は C をパス区切りとして、(複数の ルートディレクトリや、NIL: や LPT: のような様々な「ルートでない」 デバイスファイルといった)独自の風変わりな方法で Unix と似たように 動作します。 =begin original S 9 and earlier used C<:> as a path separator instead of C. =end original S 9 以前はパス区切りに C ではなく C<:> を使います。 =begin original The filesystem may support neither hard links (C) nor symbolic links (C, C, C). =end original ファイルシステムはハードリンク (C) やシンボリックリンク (C, C, C) に対応していないかもしれません。 =begin original The filesystem may support neither access timestamp nor change timestamp (meaning that about the only portable timestamp is the modification timestamp), or one second granularity of any timestamps (e.g. the FAT filesystem limits the time granularity to two seconds). =end original ファイルシステムはアクセスタイムスタンプや変更タイムスタンプに 対応していないかもしれません (つまり移植性のあるタイムスタンプは 変更タイムスタンプだけです); またタイムスタンプは 1 秒単位では ないかもしれません (例えば、FAT ファイルシステムは時刻の単位は 2 秒単位です)。 =begin original The "inode change timestamp" (the C<-C> filetest) may really be the "creation timestamp" (which it is not in Unix). =end original 「inode 変更タイムスタンプ」 (C<-C> ファイルテスト) は (Unix 以外では) 実際には「作成タイムスタンプ」かもしれません。 =begin original VOS perl can emulate Unix filenames with C as path separator. The native pathname characters greater-than, less-than, number-sign, and percent-sign are always accepted. =end original VOS perl は C をパス区切りとして Unix ファイル名をエミュレートできます。 ネイティブなパス名文字である大なり、小なり、シャープ、パーセントは常に 受け入れられます。 =begin original S perl can emulate Unix filenames with C as path separator, or go native and use C<.> for path separator and C<:> to signal filesystems and disk names. =end original S perl は C をパス区切りとして Unix ファイル名をエミュレート するか、ネイティブのままで C<.> をパス区切り、C<:> をファイルシステムと ディスクの名前として使えます。 =begin original Don't assume Unix filesystem access semantics: that read, write, and execute are all the permissions there are, and even if they exist, that their semantics (for example what do C<"r">, C<"w">, and C<"x"> mean on a directory) are the Unix ones. The various Unix/POSIX compatibility layers usually try to make interfaces like C work, but sometimes there simply is no good mapping. =end original Unix のファイルシステムアクセスの意味を仮定しないで下さい: 読み込み、 書き込み、実行のどれもです; たとえあったとしても、その意味論 (例えばディレクトリに対して C<"r">, C<"w">, C<"x"> が何をするか) は Unix のものです。 様々な Unix/POSIX 互換層は普通 C のようなものが動作するための インターフェースとなっていますが、ときどき単にいいマッピングが ないこともあります。 =begin original The C modules provide methods to manipulate path specifications and return the results in native format for each platform. This is often unnecessary as Unix-style paths are understood by Perl on every supported platform, but if you need to produce native paths for a native utility that does not understand Unix syntax, or if you are operating on paths or path components in unknown (and thus possibly native) syntax, C is your friend. Here are two brief examples: =end original C モジュールはパス仕様を操作し、各プラットフォームにネイティブな 型式での結果を返します。 Perl は全ての対応しているプラットフォームで Unix 型式のパスを理解するので これはしばしば不要でが、Unix 文法を理解しないネイティブな ユーティリティのためにネイティブなパスを生成する必要がある場合や、 不明な(従っておそらくネイティブな)文法のパスやパス要素を操作する場合に、 C が役に立ちます。 次の二つは概要の例です: use File::Spec::Functions; chdir(updir()); # go up one directory # Concatenate a path from its components my $file = catfile(updir(), 'temp', 'file.txt'); # on Unix: '../temp/file.txt' # on Win32: '..\temp\file.txt' # on VMS: '[-.temp]file.txt' =begin original In general, production code should not have file paths hardcoded. Making them user-supplied or read from a configuration file is better, keeping in mind that file path syntax varies on different machines. =end original 一般的に、製品コードはファイルパスをハードコーディングするべきでは ありません。 ユーザーが指定できるようにするか、設定ファイルから読み込む方がよいです; ファイルパスの文法はマシンによって異なることを忘れないでください。 =begin original This is especially noticeable in scripts like Makefiles and test suites, which often assume C as a path separator for subdirectories. =end original これは、しばしば C がサブディレクトリのパス区切りと仮定されている Makefile やテストスイートのようなスクリプトで特に注意が必要です。 =begin original Also of use is C from the standard distribution, which splits a pathname into pieces (base filename, full path to directory, and file suffix). =end original もう一つの有用なものは標準配布に含まれている C で、これは パス名をベースファイル名、ディレクトリのフルパス、ファイルの拡張子に 分解します。 =begin original Even when on a single platform (if you can call Unix a single platform), remember not to count on the existence or the contents of particular system-specific files or directories, like F, F, F, or even F. For example, F may exist but not contain the encrypted passwords, because the system is using some form of enhanced security. Or it may not contain all the accounts, because the system is using NIS. If code does need to rely on such a file, include a description of the file and its format in the code's documentation, then make it easy for the user to override the default location of the file. =end original 単一のプラットフォームでさえ(Unix を単一のプラットフォームと呼ぶなら)、 F, F, F あるいは F でさえ、特定のシステム固有のファイルやディレクトリの存在や その内容を当てにできないことを忘れないでください。 例えば、F は存在するかもしれませんが、システムがある種の 強化されたセキュリティを使っているために、暗号化されたパスワードを 含んでいないかもしれません。 あるいは、NIS を使っているために、全てのアカウントを 含んでいないかもしれません。 コードがこのようなファイルに依存する必要がある場合、コードの文書に ファイルの説明とその形式を含めて、ユーザーがファイルのデフォルトの位置を 簡単に上書きできるようにします。 =begin original Don't assume a text file will end with a newline. They should, but people forget. =end original テキストファイルが改行で終わっていると仮定しないでください。 そうあるべきですが、人は忘れます。 =begin original Do not have two files or directories of the same name with different case, like F and F, as many platforms have case-insensitive (or at least case-forgiving) filenames. Also, try not to have non-word characters (except for C<.>) in the names, and keep them to the 8.3 convention, for maximum portability, onerous a burden though this may appear. =end original F と F のような、大文字と小文字が違うだけの名前の二つの ファイルやディレクトリを作らないでください; 多くのプラットフォームは 大文字小文字を無視する(あるいは少なくとも大文字小文字に寛容な) ファイル名を持つからです。 また、最大限の互換性のため、起きるかも知れない厄介事のために、 (C<.> 以外の)非単語文字を使わないようにして、8.3 の規約を維持してください。 =begin original Likewise, when using the C module, try to keep your functions to 8.3 naming and case-insensitive conventions; or, at the least, make it so the resulting files have a unique (case-insensitively) first 8 characters. =end original 同様に、C モジュールを使う場合、関数の 8.3 の命名と大文字小文字を 無視する規約を維持するようにしてください; あるいは、少なくとも、 結果のファイルが最初の 8 文字が(大文字小文字を無視して)ユニークに なるようにしてください。 =begin original Whitespace in filenames is tolerated on most systems, but not all, and even on systems where it might be tolerated, some utilities might become confused by such whitespace. =end original ファイル名の空白はほとんどのシステムで許容されますが、全てではなく、 許容しているシステムでも、そのような空白によって混乱するユーティリティも あります。 =begin original Many systems (DOS, VMS ODS-2) cannot have more than one C<.> in their filenames. =end original 多くのシステム (DOS, VMS ODS-2) はファイル名に二つ以上の C<.> を 使えません。 =begin original Don't assume C<< > >> won't be the first character of a filename. Always use C<< < >> explicitly to open a file for reading, or even better, use the three-arg version of C, unless you want the user to be able to specify a pipe open. =end original C<< > >> がファイル名の最初の文字ではないと仮定しないでください。 ユーザーがパイプで開けるようにしたいのでない限り、読み込みのためにファイルを 開くときには常に明示的に C<< < >> を使うか、もっとよいのは、3 引数版の C を使ってください。 open my $fh, '<', $existing_file) or die $!; =begin original If filenames might use strange characters, it is safest to open it with C instead of C. C is magic and can translate characters like C<< > >>, C<< < >>, and C<|>, which may be the wrong thing to do. (Sometimes, though, it's the right thing.) Three-arg open can also help protect against this translation in cases where it is undesirable. =end original もしファイル名におかしな文字が使われているかも知れないなら、 C ではなく C を使って開くのがもっとも安全です。 C はマジカルで、C<< > >>, C<< < >>, C<|> のような文字を 変換することがあり、これは間違ったことかもしれません。 (しかし、時々は、これは正しいことです。) 3 引数形式の open も予想していない状況でこの変換から守る助けになります。 =begin original Don't use C<:> as a part of a filename since many systems use that for their own semantics (Mac OS Classic for separating pathname components, many networking schemes and utilities for separating the nodename and the pathname, and so on). For the same reasons, avoid C<@>, C<;> and C<|>. =end original C<:> をファイル名の一部として使わないでください; 多くのシステムがこれを 独自の意味で使っているからです (Mac OS Classic はパス名要素を分割するために、 多くのネットワークスキームとユーティリティではノード名とパス名を 分割するために、など)。 同じ理由で、C<@>, C<;>, C<|> も避けてください。 =begin original Don't assume that in pathnames you can collapse two leading slashes C into one: some networking and clustering filesystems have special semantics for that. Let the operating system sort it out. =end original パス名の先頭の二つのスラッシュ C を一つに圧縮できると 仮定しないでください: ある種のネットワーキングとクラスタリングの ファイルシステムはこれに対して特別な意味論を持ちます。 オペレーティングシステムに任せてください。 =begin original The I as defined by ANSI C are =end original ANSI C で定義されている、I<移植性のあるファイル名の文字> は: a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9 . _ - =begin original and the C<"-"> shouldn't be the first character. If you want to be hypercorrect, stay case-insensitive and within the 8.3 naming convention (all the files and directories have to be unique within one directory if their names are lowercased and truncated to eight characters before the C<.>, if any, and to three characters after the C<.>, if any). (And do not use C<.>s in directory names.) =end original かつ C<"-"> は最初の文字には使えません。 もし超完全にしたいなら、大文字小文字は無視して、8.3 命名規約に従います (全てのファイルとディレクトリは、名前を小文字にして、(もしあれば) C<.> の 前の 8 文字と (もしあれば) C<.> の後の 3 文字に切り詰めたときに、 ディレクトリ内でユニークである必要があります)。 (そしてディレクトリ名に C<.> を使わないでください。) =head2 System Interaction (システムの相互作用) =begin original Not all platforms provide a command line. These are usually platforms that rely primarily on a Graphical User Interface (GUI) for user interaction. A program requiring a command line interface might not work everywhere. This is probably for the user of the program to deal with, so don't stay up late worrying about it. =end original 全てのプラットフォームがコマンドラインを提供しているわけではありません。 これらは普通ユーザーとの相互作用にグラフィカルユーザーインターフェース (GUI) に基本的に依存しています。 コマンドラインインターフェースを要求するプログラムはどこでも 動作するわけではありません。 これはおそらくプログラムを扱うユーザーの問題なので、心配して遅くまで 起きていないでください。 =begin original Some platforms can't delete or rename files held open by the system, this limitation may also apply to changing filesystem metainformation like file permissions or owners. Remember to C files when you are done with them. Don't C or C an open file. Don't C or C a file already tied or opened; C or C it first. =end original 一部のプラットフォームはシステムによって開かれているファイルを削除または リネームできません; この制限はファイル権限や所有者のような ファイルシステムのメタ情報の変更にも適用されることもあります。 ファイルに対する作業が終わったら、C することを忘れないでください。 開いているファイルに対して C または C しないでください。 すでに tie されていたり開かれていたりするファイルに対して C や C をしないで下さい; まず C または C してください。 =begin original Don't open the same file more than once at a time for writing, as some operating systems put mandatory locks on such files. =end original 同じファイルを同時に 2 回以上書き込みのために開いてはいけません; 一部のオペレーティングシステムはそのようなファイルに排他的ロックを掛けます。 =begin original Don't assume that write/modify permission on a directory gives the right to add or delete files/directories in that directory. That is filesystem specific: in some filesystems you need write/modify permission also (or even just) in the file/directory itself. In some filesystems (AFS, DFS) the permission to add/delete directory entries is a completely separate permission. =end original ディレクトリへの書き込み/修正権限があれば、そのディレクトリにある ファイル/ディレクトリを追加または削除できると仮定しないでください。 これはファイルシステム依存です: そのファイル/ディレクトリ自身の 書き込み/修正権限も(あるいはそれだけが)必要なファイルシステムもあります。 一部のファイルシステム (AFS, DFS) では、ディレクトリ要素の追加/削除権限は 完全に別の権限です。 =begin original Don't assume that a single C completely gets rid of the file: some filesystems (most notably the ones in VMS) have versioned filesystems, and C removes only the most recent one (it doesn't remove all the versions because by default the native tools on those platforms remove just the most recent version, too). The portable idiom to remove all the versions of a file is =end original 1 回の C で完全にファイルを取り除けると仮定しないでください: 一部のファイルシステム (もっとも顕著なものは VMS) はバージョン管理された ファイルシステムを持ち、C は単に最新のものだけを削除します (デフォルトではネイティブなツールも単に最新のバージョンを削除するので、 全てのバージョンは削除しません)。 あるファイルの全てのバージョンを削除するための移植性のある慣用句は: 1 while unlink "file"; =begin original This will terminate if the file is undeleteable for some reason (protected, not there, and so on). =end original これは (保護されている、存在しない、など) 何らかの理由でファイルが 削除できないときに終了します。 =begin original Don't count on a specific environment variable existing in C<%ENV>. Don't count on C<%ENV> entries being case-sensitive, or even case-preserving. Don't try to clear C<%ENV> by saying C<%ENV = ();>, or, if you really have to, make it conditional on C<$^O ne 'VMS'> since in VMS the C<%ENV> table is much more than a per-process key-value string table. =end original 特定の環境変数が C<%ENV> にあるということを計算に入れないでください。 C<%ENV> のエントリが大文字小文字を認識するかや、大文字小文字が 保存されるかすらも計算に入れないでください。 C<%ENV> をクリアするために C<%ENV = ();> としないでください; もし 本当にそうする必要があるなら、C<$^O ne 'VMS'> という条件付きで 行ってください; VMS では C<%ENV> テーブルはプロセス単位のキー/値文字列 テーブル以上のものだからです。 =begin original On VMS, some entries in the C<%ENV> hash are dynamically created when their key is used on a read if they did not previously exist. The values for C<$ENV{HOME}>, C<$ENV{TERM}>, C<$ENV{PATH}>, and C<$ENV{USER}>, are known to be dynamically generated. The specific names that are dynamically generated may vary with the version of the C library on VMS, and more may exist than are documented. =end original VMS では、C<%ENV> ハッシュの一部のエントリは、キーがまだ存在していなければ、 読み込みに使われたときに動的に作成されます。 C<$ENV{HOME}>, C<$ENV{TERM}>, C<$ENV{PATH}>, and C<$ENV{USER}> の値は 動的に作成されると知られています。 動的に作成される具体的な名前は VMS の C ライブラリのバージョンによって 異なり、文書化されているものよりもたくさんあるかもしれません。 =begin original On VMS by default, changes to the %ENV hash persist after perl exits. Subsequent invocations of perl in the same process can inadvertently inherit environment settings that were meant to be temporary. =end original VMS のデフォルトでは、%ENV ハッシュへの変更は、perl が終了した後に 永続化します。 同じプロセスで引き続いて perl を起動すると、一時的のつもりの環境設定が 不注意で継承されることがあります。 =begin original Don't count on signals or C<%SIG> for anything. =end original シグナルや C<%SIG> について何も当てにしないで下さい。 =begin original Don't count on filename globbing. Use C, C, and C instead. =end original ファイル名のグロブを当てにしないで下さい。 代わりに C, C, C を使ってください。 =begin original Don't count on per-program environment variables, or per-program current directories. =end original プログラム単位の環境変数や、プログラム単位のカレントディレクトリを 当てにしないで下さい。 =begin original Don't count on specific values of C<$!>, neither numeric nor especially the string values. Users may switch their locales causing error messages to be translated into their languages. If you can trust a POSIXish environment, you can portably use the symbols defined by the C module, like C. And don't trust on the values of C<$!> at all except immediately after a failed system call. =end original C<$!> の特定の値を計算に入れないでください; 数値でも、特に文字列値でもです。 ユーザーは自分の言語へ翻訳するためにエラーメッセージを引き起こす ロケールを変更するかもしれません。 もし POSIX 的な環境を信用できるなら、C のような、C モジュールで 定義されているシンボルを移植性を持って使えます。 そして、システムコールが失敗した直後以外では C<$!> の値は全く 信用しないでください。 =head2 Command names versus file pathnames (コマンド名かファイルパス名か) =begin original Don't assume that the name used to invoke a command or program with C or C can also be used to test for the existence of the file that holds the executable code for that command or program. First, many systems have "internal" commands that are built-in to the shell or OS and while these commands can be invoked, there is no corresponding file. Second, some operating systems (e.g., Cygwin, DJGPP, OS/2, and VOS) have required suffixes for executable files; these suffixes are generally permitted on the command name but are not required. Thus, a command like F<"perl"> might exist in a file named F<"perl">, F<"perl.exe">, or F<"perl.pm">, depending on the operating system. The variable C<"_exe"> in the C module holds the executable suffix, if any. Third, the VMS port carefully sets up C<$^X> and C<$Config{perlpath}> so that no further processing is required. This is just as well, because the matching regular expression used below would then have to deal with a possible trailing version number in the VMS file name. =end original C や C でコマンドやプログラムを起動するために使われた名前が、 そのコマンドやプログラムの実行可能コードを保持しているファイルの存在の テストにも使えると仮定しないでください。 1 番目に、多くのシステムはシェルや OS に組み込まれている「内部」コマンドを 持ち、これらのコマンドは起動できますが、対応するファイルはありません。 2 番目に、一部のオペレーティングシステム(例えば Cygwin, DJGPP, OS/2, VOS) は 実行ファイルに拡張子が必要です; これらの拡張子は一般的にコマンド名として ゆるされていますが要求されてはいません。 従って、F<"perl"> のようなコマンドは OS に依存して、F<"perl">, F<"perl.exe">, F<"perl.pm"> のようなファイルとして存在しているかもしれません。 C モジュールの変数 C<"_exe"> は、(もしあれば)実行形式の拡張子を 保持します。 3 番目に、VMS 版はそれ以上の処理が不要なように慎重に C<$^X> と C<$Config{perlpath}> を設定します。 これは、以下に示す正規表現のマッチングがそれから VMS ファイル名に あるかもしれない末尾のバージョン番号を扱う必要があるからです。 =begin original To convert C<$^X> to a file pathname, taking account of the requirements of the various operating system possibilities, say: =end original C<$^X> をファイルパス名に変換するとき、以下のように、様々な オペレーティングシステムの可能性の要求を考慮してください: use Config; my $thisperl = $^X; if ($^O ne 'VMS') {$thisperl .= $Config{_exe} unless $thisperl =~ m/$Config{_exe}$/i;} =begin original To convert C<$Config{perlpath}> to a file pathname, say: =end original C<$Config{perlpath}> をファイルのパス名に変換するには、例えば: use Config; my $thisperl = $Config{perlpath}; if ($^O ne 'VMS') {$thisperl .= $Config{_exe} unless $thisperl =~ m/$Config{_exe}$/i;} =head2 Networking (ネットワーク) =begin original Don't assume that you can reach the public Internet. =end original 公共のインターネットに届くことを仮定しないでください。 =begin original Don't assume that there is only one way to get through firewalls to the public Internet. =end original ファイアウォールを通って公共のインターネットへ出る道が 一つだけあるということを仮定しないでください。 =begin original Don't assume that you can reach outside world through any other port than 80, or some web proxy. ftp is blocked by many firewalls. =end original ポート 80 やいくつかのウェブプロキシ以外で、外側の世界に届くことを 仮定しないでください。 ftp は多くのファイアウォールでブロックされます。 =begin original Don't assume that you can send email by connecting to the local SMTP port. =end original ローカル SMTP ポートに接続することで e メールを送信できると 仮定しないでください。 =begin original Don't assume that you can reach yourself or any node by the name 'localhost'. The same goes for '127.0.0.1'. You will have to try both. =end original 'localhost' という名前で自分自身やその他のノードに届くと 仮定しないでください。 同じことは '127.0.0.1' にも言えます。 両方を試す必要があります。 =begin original Don't assume that the host has only one network card, or that it can't bind to many virtual IP addresses. =end original ホストに 1 枚だけネットワークカードがあるとか、複数の仮想 IP アドレスを 割り当てられないと仮定しないでください。 =begin original Don't assume a particular network device name. =end original 特定のネットワークデバイス名を仮定しないでください。 =begin original Don't assume a particular set of Cs will work. =end original 特定の C が動作することを仮定しないでください。 =begin original Don't assume that you can ping hosts and get replies. =end original ホストに ping して結果が受け取れると仮定しないでください。 =begin original Don't assume that any particular port (service) will respond. =end original 特定のポート (サービス) が返答すると仮定しないでください。 =begin original Don't assume that C (or any other API or command) returns either a fully qualified hostname or a non-qualified hostname: it all depends on how the system had been configured. Also remember that for things such as DHCP and NAT, the hostname you get back might not be very useful. =end original C (またはその他の API やコマンド) が完全修飾ホスト名か 修飾されないホスト名のどちらかを返すと仮定しないでください: これら全ては システムがどのように設定されているかに依存します。 また、DHCP や NAT のようなものでは、受け取るホスト名は全く 有用ではないかもしれないことも忘れないでください。 =begin original All the above Is may look daunting, and they are, but the key is to degrade gracefully if one cannot reach the particular network service one wants. Croaking or hanging do not look very professional. =end original 上述した全ての I<べからず> は怯えさせるものかもしれません; そしてその 通りです; しかし鍵は、望んでいる特定のネットワークサービスに 到達できないときに、適切にデグレードすることです。 croak やハングアップではとてもプロの仕事には見えません。 =head2 Interprocess Communication (IPC) (プロセス間通信(IPC)) =begin original In general, don't directly access the system in code meant to be portable. That means, no C, C, C, C, C<``>, C, C with a C<|>, nor any of the other things that makes being a Perl hacker worth being. =end original 一般的に、移植性を持たせるコード内でシステムに直接アクセスしないでください。 つまり、C, C, C, C, C<``>, C, C での C<|> その他 Perl ハッカーが価値があると思うものです。 =begin original Commands that launch external processes are generally supported on most platforms (though many of them do not support any type of forking). The problem with using them arises from what you invoke them on. External tools are often named differently on different platforms, may not be available in the same location, might accept different arguments, can behave differently, and often present their results in a platform-dependent way. Thus, you should seldom depend on them to produce consistent results. (Then again, if you're calling I, you probably don't expect it to run on both Unix and CP/M.) =end original 外部プロセスを起動するコマンドは一般的にほとんどのプラットフォームで 対応しています(しかしその多くは fork に対応していません)。 これらを使うときの問題は何を起動するかということから発生します。 外部ツールはプラットフォームが異なればしばしば異なった名前となり、 同じ場所で利用可能ではないかもしれず、異なった引数を受け取るかもしれず、 異なった動作をするかもしれず、しばしば結果をプラットフォームに依存した形で 表現します。 従って、一貫した結果を生成するために、ほとんどそのようなものに 依存しないようにするべきです。 (再び、I を呼び出すなら、おそらく Unix と CP/M の両方で 呼び出すことを想定していないでしょう。) =begin original One especially common bit of Perl code is opening a pipe to B: =end original 特に一般的な Perl コードの一つは B へのパイプを開くことです: open(MAIL, '|/usr/lib/sendmail -t') or die "cannot fork sendmail: $!"; =begin original This is fine for systems programming when sendmail is known to be available. But it is not fine for many non-Unix systems, and even some Unix systems that may not have sendmail installed. If a portable solution is needed, see the various distributions on CPAN that deal with it. C and C in the C distribution are commonly used, and provide several mailing methods, including C, C, and direct SMTP (via C) if a mail transfer agent is not available. C is a standalone module that provides simple, platform-independent mailing. =end original sendmail が利用可能であることが分かっているならシステム プログラミングとしてうまく動きます。 しかし多くの非 Unix システムや、Unix でも sendmail が インストールされていないシステムではうまく動きません。 移植性のある解法が必要なら、CPAN にあるこれを扱うための様々な ディストリビューションを参照してください。 C および C の C は一般的に使われ、C、 C、メール転送エージェントが利用できないなら (C 経由で) SMTP 直接を含むいくつかのメール送信メソッドを提供します。 C は単純で、プラットフォーム独立なメール送信を提供する 単体のモジュールです。 =begin original The Unix System V IPC (C) is not available even on all Unix platforms. =end original Unix System V IPC (C) は Unix プラットフォームでさえも全てで利用できるわけではありません。 =begin original Do not use either the bare result of C or bare v-strings (such as C) to represent IPv4 addresses: both forms just pack the four bytes into network order. That this would be equal to the C language C struct (which is what the socket code internally uses) is not guaranteed. To be portable use the routines of the C extension, such as C, C, and C. =end original IPv4 アドレスを表現するために C の生の結果や (C のような)生のv-文字列を使わないでください: どちらの 形式も単に 4 バイトをネットワーク順序で pack しています。 これが(ソケットコードが内部で使う) C 言語の C 構造体と 同じであることは保証されていません。 移植性を持たせるためには、C, C, C のような、C エクステンションのルーチンを 使ってください。 =begin original The rule of thumb for portable code is: Do it all in portable Perl, or use a module (that may internally implement it with platform-specific code, but exposes a common interface). =end original 移植性のあるコードのための経験的な法則は: 全て移植性のある Perl でするか、 モジュールを使ってください (これは内部でプラットフォーム依存の実装を しているかもしれませんが、一般的なインターフェースを晒しています)。 =head2 External Subroutines (XS) (外部サブルーチン(XS)) =begin original XS code can usually be made to work with any platform, but dependent libraries, header files, etc., might not be readily available or portable, or the XS code itself might be platform-specific, just as Perl code might be. If the libraries and headers are portable, then it is normally reasonable to make sure the XS code is portable, too. =end original XS コードは普通どのプラットフォームでも動作するように作られていますが、 依存ライブラリ、ヘッダファイルなどが利用可能でなかったり移植性がなかったり、 XS コード自身が (Perl コードがそうであるかもしれないように) プラットフォーム依存かもしれません。 ライブラリとヘッダに移植性があるなら、XS コードも移植性があると 考えるのは普通合理的です。 =begin original A different type of portability issue arises when writing XS code: availability of a C compiler on the end-user's system. C brings with it its own portability issues, and writing XS code will expose you to some of those. Writing purely in Perl is an easier way to achieve portability. =end original XS コードを書くときには違った種類の移植性の問題が発生します: エンドユーザーのシステムで C コンパイラが利用できるかです。 C はそれ自身の移植性の問題があり、XS コードはそれらのいくつかを晒します。 ピュア Perl で書くことは移植性を達成するより簡単な方法です。 =head2 Standard Modules (標準モジュール) =begin original In general, the standard modules work across platforms. Notable exceptions are the C module (which currently makes connections to external programs that may not be available), platform-specific modules (like C), and DBM modules. =end original 一般的に、標準モジュールはどのプラットフォームでも動きます。 注目するべき例外は C モジュール (今のところ利用可能でないかもしれない 外部プログラムと接続します)、(C のような) プラットフォーム固有のモジュール、DBM モジュールです。 =begin original There is no one DBM module available on all platforms. C and the others are generally available on all Unix and DOSish ports, but not in MacPerl, where only C and C are available. =end original 全てのプラットフォームで利用可能な DBM モジュールはありません。 C とその他は一般的に全ての Unix と DOS 風版で利用可能ですが、 MacPerl では利用できず、C と C のみが利用可能です。 =begin original The good news is that at least some DBM module should be available, and C will use whichever module it can find. Of course, then the code needs to be fairly strict, dropping to the greatest common factor (e.g., not exceeding 1K for each record), so that it will work with any DBM module. See L for more details. =end original いい知らせは、少なくとも何らかの DBM モジュールは利用可能なはずで、 C は見付かったどれかのモジュールを使います。 もちろん、任意の DBM モジュールで動作させるために、コードはかなり厳密で、 最大公約数的機能に限定されます(例えば、各レコードは 1K を超えられません)。 さらなる詳細については L を参照してください。 =head2 Time and Date (時刻と日付) =begin original The system's notion of time of day and calendar date is controlled in widely different ways. Don't assume the timezone is stored in C<$ENV{TZ}>, and even if it is, don't assume that you can control the timezone through that variable. Don't assume anything about the three-letter timezone abbreviations (for example that MST would be the Mountain Standard Time, it's been known to stand for Moscow Standard Time). If you need to use timezones, express them in some unambiguous format like the exact number of minutes offset from UTC, or the POSIX timezone format. =end original カレンダー日付と時刻のシステムでの記法は大きく異なった方法で 制御されています。 タイムゾーンが C<$ENV{TZ}> に保管されていると仮定しないでください; また例え保管されていても、この変数でタイムゾーンを制御できると 仮定しないでください。 3 文字タイムゾーン略称について何の仮定もしないで下さい (例えば MST は Mountain Standard Time かもしれませんが、Moscow Standard Time としても 知られています)。 タイムゾーンを使う必要があるなら、UTC からの正確な分数や POSIX タイムゾーン形式のような、曖昧さのない形式で記述してしてください。 =begin original Don't assume that the epoch starts at 00:00:00, January 1, 1970, because that is OS- and implementation-specific. It is better to store a date in an unambiguous representation. The ISO 8601 standard defines YYYY-MM-DD as the date format, or YYYY-MM-DDTHH:MM:SS (that's a literal "T" separating the date from the time). Please do use the ISO 8601 instead of making us guess what date 02/03/04 might be. ISO 8601 even sorts nicely as-is. A text representation (like "1987-12-18") can be easily converted into an OS-specific value using a module like C. An array of values, such as those returned by C, can be converted to an OS-specific representation using C. =end original 紀元が 1970 年 1 月 1 日 00:00:00 に開始されると仮定しないでください; なぜならこれは OS と実装に依存するからです。 曖昧さのない表現で日付を保管した方が良いです。 ISO 8601 標準は日付の形式として YYYY-MM-DD を、あるいは YYYY-MM-DDTHH:MM:SS (リテラルな "T" は日付と時刻を分けています) を 定義しています。 どうか 02/03/04 という日付の意味を推測させるのではなく、ISO 8601 を 使ってください。 ISO 8601 はそのままうまくソートもできます。 ("1987-12-18" のような) テキスト表現は C のようなモジュールを 使って簡単に OS 固有の値に変換できます。 C で返されるような値の配列は、C を使って OS 固有の 表現に変換できます。 =begin original When calculating specific times, such as for tests in time or date modules, it may be appropriate to calculate an offset for the epoch. =end original 時刻と日付のモジュールのテストのような、特定の時刻を計算するときには、 紀元からのオフセットを計算するのが適切でしょう。 require Time::Local; my $offset = Time::Local::timegm(0, 0, 0, 1, 0, 70); =begin original The value for C<$offset> in Unix will be C<0>, but in Mac OS Classic will be some large number. C<$offset> can then be added to a Unix time value to get what should be the proper value on any system. =end original Unix での C<$offset> の値は C<0> ですが、Mac OS Classic では 大きな数になります。 それから、C<$offset> は任意のシステムでの適切な値を得るために Unix time に加えられます。 =head2 Character sets and character encoding (文字集合と文字エンコーディング) =begin original Assume very little about character sets. =end original 文字集合について仮定できることはほとんどありません。 =begin original Assume nothing about numerical values (C, C) of characters. Do not use explicit code point ranges (like C<\xHH-\xHH)>. However, starting in Perl v5.22, regular expression pattern bracketed character class ranges specified like C are portable, and starting in Perl v5.24, the same ranges are portable in C. You can portably use symbolic character classes like C<[:print:]>. =end original 文字の数値 (C, C) について仮定できることはありません。 (C<\xHH-\xHH> のような) 明示的な符号位置の範囲は使わないでください。 しかし、Perl v5.22 から、C のように指定した 正規表現パターン大括弧文字クラス範囲は移植性があり、 Perl 5.24 から、同じ範囲は C でも移植性があります。 移植性のある形で C<[:print:]> のようなシンボリックな文字クラスを使えます。 =begin original Do not assume that the alphabetic characters are encoded contiguously (in the numeric sense). There may be gaps. Special coding in Perl, however, guarantees that all subsets of C, C, and C behave as expected. C behaves the same for these ranges. In patterns, any ranges specified with end points using the C<\N{...}> notations ensures character set portability, but it is a bug in Perl v5.22, that this isn't true of C, fixed in v5.24. =end original 英字が(数値的な意味で)連続してエンコードされると仮定しないでください。 隙間があるかもしれません。 しかし、Perl での特別扱いにより、C, C, C という部分集合は想定通り振る舞うことが保証されます。 C はこれらの範囲と同様に振る舞います。 In patterns, any ranges specified with end points using the パターンにおいて、C<\N{...}> 記法を使ったエンドポイントで指定した 範囲は文字集合間で移植性がありますが、Perl 5.22 にはバグがより、 これは C には当てはまりませんでした; v5.24 で修正されました。 =begin original Do not assume anything about the ordering of the characters. The lowercase letters may come before or after the uppercase letters; the lowercase and uppercase may be interlaced so that both "a" and "A" come before "b"; the accented and other international characters may be interlaced so that E comes before "b". L can be used to sort this all out. =end original 文字の順序について何も仮定しないでください。 小文字は大文字の前かもしれませんし後かもしれません; 小文字と大文字が交互に 来るために、"a" と "A" の両方が "b" の前かもしれません; アクセント文字や その他の国際文字は交互に来るかも知れないので E は "b" の 前かもしれません。 L はこれらのソートに使えます。 =head2 Internationalisation (国際化) =begin original If you may assume POSIX (a rather large assumption), you may read more about the POSIX locale system from L. The locale system at least attempts to make things a little bit more portable, or at least more convenient and native-friendly for non-English users. The system affects character sets and encoding, and date and time formatting--amongst other things. =end original POSIX (比較的大きい仮定) を仮定するなら、L から POSIX ロケールシステムについて多くを読めます。 ロケールシステムは少なくとも物事をもう少し移植性のある形にしようとする、 あるいは少なくとも非英語ユーザにとってより便利で母国語に親しくするものです。 このシステムは文字集合とエンコーディング、日付と時刻の形式 -- 他のものに 混じって -- に影響を与えます。 =begin original If you really want to be international, you should consider Unicode. See L and L for more information. =end original もし本当に国際化したいなら、Unicode を考慮するべきです。 さらなる情報については L と L を 参照してください。 =begin original If you want to use non-ASCII bytes (outside the bytes 0x00..0x7f) in the "source code" of your code, to be portable you have to be explicit about what bytes they are. Someone might for example be using your code under a UTF-8 locale, in which case random native bytes might be illegal ("Malformed UTF-8 ...") This means that for example embedding ISO 8859-1 bytes beyond 0x7f into your strings might cause trouble later. If the bytes are native 8-bit bytes, you can use the C pragma. If the bytes are in a string (regular expressions being curious strings), you can often also use the C<\xHH> or more portably, the C<\N{U+HH}> notations instead of embedding the bytes as-is. If you want to write your code in UTF-8, you can use L. =end original 非 ASCII バイト (0x00..0x7f の範囲外のバイト) を「ソースコード」に 使いたいなら、移植性のために、そのバイトが何であるかを明示的にする必要が あります。 誰かが例えばそのコードを UTF-8 ロケールで使うかもしれず、その場合 ランダムなネイティブのバイトは不正となります ("Malformed UTF-8 ...")。 これは例えば 0x7f を超える ISO 8859-1 のバイトを文字列に組み込むと あとで問題を引き起こすかもしれないということです。 そのバイトがネイティブな 8 ビットバイトなら、C プラグマを使えます。 そのバイトが文字列にある(正規表現はおかしな文字列になります)なら、 そのバイトをそのまま組み込む代わりに C<\xHH> や、より移植性のある C<\N{U+HH}> 表記もしばしば使われます。 コードを UTF-8 で書きたいなら、L が使えます。 =head2 System Resources (システムリソース) =begin original If your code is destined for systems with severely constrained (or missing!) virtual memory systems then you want to be I mindful of avoiding wasteful constructs such as: =end original あなたのコードが仮想メモリについて厳しく制限された(あるいは存在しない!) システムで動作することになっているなら、I<特に> 以下のような無駄な構造を 避けたいです: my @lines = <$very_large_file>; # bad while (<$fh>) {$file .= $_} # sometimes bad my $file = join('', <$fh>); # better =begin original The last two constructs may appear unintuitive to most people. The first repeatedly grows a string, whereas the second allocates a large chunk of memory in one go. On some systems, the second is more efficient than the first. =end original 最後の二つの構造はほとんどの人々にとって直観的ではないかもしれません。 一番目は徐々に文字列が大きくなり、二番目は一度に大きなメモリの塊を 割り当てます。 システムによっては、二番目の方が一番目よりも効率的です。 =head2 Security (セキュリティ) =begin original Most multi-user platforms provide basic levels of security, usually implemented at the filesystem level. Some, however, unfortunately do not. Thus the notion of user id, or "home" directory, or even the state of being logged-in, may be unrecognizable on many platforms. If you write programs that are security-conscious, it is usually best to know what type of system you will be running under so that you can write code explicitly for that platform (or class of platforms). =end original ほとんどのマルチユーザプラットフォームでは(普通はファイルシステムで 実装された)基本的なレベルのセキュリティを提供しています。 しかし、一部は残念ながらそうではありません。 従ってユーザー ID、"home" ディレクトリ、あるいはログインしているかどうか という概念すら多くのプラットフォームでは認識できないかもしれません。 セキュリティを意識したプログラムを書くなら、どの種類のシステムで 実行されるかを知るのが普通は最良です; これによって明示的にその プラットフォーム(またはプラットフォームの種類)のためのコードを書けます。 =begin original Don't assume the Unix filesystem access semantics: the operating system or the filesystem may be using some ACL systems, which are richer languages than the usual C. Even if the C exist, their semantics might be different. =end original Unix のファイルシステムアクセス意味論を仮定しないでください: オペレーティングシステムやファイルシステムは通常の C よりも豊富な 機能を持つ ACL システムを使っているかもしれません。 C が存在したとしても、意味は違うかもしれません。 =begin original (From the security viewpoint, testing for permissions before attempting to do something is silly anyway: if one tries this, there is potential for race conditions. Someone or something might change the permissions between the permissions check and the actual operation. Just try the operation.) =end original (セキュリティの面からは、何かをしようとする前に権限をテストするのは そもそもばかげています: そうしようとすると、潜在的な競合条件があります。 権限チェックと実際の操作の間に誰かまたは何かが権限を変えるかもしれません。 単に操作を試してください。) =begin original Don't assume the Unix user and group semantics: especially, don't expect C<< $< >> and C<< $> >> (or C<$(> and C<$)>) to work for switching identities (or memberships). =end original Unix のユーザーとグループの意味論を仮定しないでください: 特に、ユーザー (あるいはグループ)を切り替えるのに C<< $< >> と C<< $> >> (または C<$(> と C<$)>) が動作すると想定しないでください。 =begin original Don't assume set-uid and set-gid semantics. (And even if you do, think twice: set-uid and set-gid are a known can of security worms.) =end original set-uid と set-gid の動作を仮定しないでください。 (そしてそうしたとしても、二度考えてください: set-uid と set-gid はセキュリティの虫の缶詰として知られています。) =head2 Style (スタイル) =begin original For those times when it is necessary to have platform-specific code, consider keeping the platform-specific code in one place, making porting to other platforms easier. Use the C module and the special variable C<$^O> to differentiate platforms, as described in L<"PLATFORMS">. =end original プラットフォーム固有のコードを書く必要がある時には、プラットフォーム固有の コードを 1 箇所に集めて、他のプラットフォームへの移植をより容易にすることを 考慮してください。 L<"PLATFORMS"> で記述されているように、プラットフォームを識別するために C モジュールと特殊変数 C<$^O> を使ってください。 =begin original Beware of the "else syndrome": =end original 「else 症候群」に注意してください: if ($^O eq 'MSWin32') { # code that assumes Windows } else { # code that assumes Linux } =begin original The C branch should be used for the really ultimate fallback, not for code specific to some platform. =end original C 節は、あるプラットフォームに特有のコードのためではなく、 本当に究極のフォールバックに使うべきです。 =begin original Be careful in the tests you supply with your module or programs. Module code may be fully portable, but its tests might not be. This often happens when tests spawn off other processes or call external programs to aid in the testing, or when (as noted above) the tests assume certain things about the filesystem and paths. Be careful not to depend on a specific output style for errors, such as when checking C<$!> after a failed system call. Using C<$!> for anything else than displaying it as output is doubtful (though see the C module for testing reasonably portably for error value). Some platforms expect a certain output format, and Perl on those platforms may have been adjusted accordingly. Most specifically, don't anchor a regex when testing an error value. =end original モジュールやプログラムと共に提供するテストには注意してください。 モジュールのコードは完全に移植性があるかも知れませんが、 テストはそうではないかもしれません。 これは、テストの助けとするために他のプロセスを起動したり外部のプログラムを 呼び出したりしたり、テストが(上述したように)ファイルシステムやパスについて ある種の仮定をしたときにしばしば起こります。 システムコールに失敗したあとの C<$!> のような、エラーの特定の出力形式に 依存しないように注意してください。 出力として表示する以外のことに C<$!> を使うことは疑問があります(しかし エラー値について十分な移植性のあるテストを刷るための C モジュールを 参照してください)。 一部のプラットフォームはある種の出力形式を想定していて、それらの プラットフォームの Perl はそれに応じて調整します。 もっとも厳密に言えば、エラー値をテストするときに正規表現を 使わないでください。 =head1 CPAN Testers =begin original Modules uploaded to CPAN are tested by a variety of volunteers on different platforms. These CPAN testers are notified by mail of each new upload, and reply to the list with PASS, FAIL, NA (not applicable to this platform), or UNKNOWN (unknown), along with any relevant notations. =end original CPAN にアップロードされたモジュールは色々なプラットフォームで 様々なボランティアによってテストされます。 これらの CPAN testers は新しくアップロードされることにメールによって 通知され、PASS, FAIL, NA (このプラットフォームでは不適切), UNKNOWN (不明) のいずれかを、関連する情報と共に返信します。 =begin original The purpose of the testing is twofold: one, to help developers fix any problems in their code that crop up because of lack of testing on other platforms; two, to provide users with information about whether a given module works on a given platform. =end original テストの目的は二つあります: 一つ目は、他のプラットフォームのテストが ないことによって突然現れるコードの問題を開発者が修正することを 助けるためです; 二つ目は、あるモジュールがあるプラットフォームで 動作するかどうかの情報をユーザーに提供することです。 =begin original Also see: =end original 以下も参照してください: =over 4 =item * =begin original Mailing list: cpan-testers-discuss@perl.org =end original メーリングリスト: cpan-testers-discuss@perl.org =item * =begin original Testing results: L =end original テスト結果: L =back =head1 PLATFORMS (プラットフォーム) =begin original Perl is built with a C<$^O> variable that indicates the operating system it was built on. This was implemented to help speed up code that would otherwise have to C and use the value of C<$Config{osname}>. Of course, to get more detailed information about the system, looking into C<%Config> is certainly recommended. =end original Perl は C<$^O> 変数がビルドされたオペレーティング システムを示すような形でビルドされます。 これは、C して C<$Config{osname}> の値を調べる必要が ないようにすることで高速化を助けています。 もちろんシステムからもっと詳細な情報を得るなら、C<%Config> を 見ることが確実にお勧めです。 =begin original C<%Config> cannot always be trusted, however, because it was built at compile time. If perl was built in one place, then transferred elsewhere, some values may be wrong. The values may even have been edited after the fact. =end original しかし、C<%Config> はコンパイル時にビルドされるので、常に 信頼するというわけにはいきません。 perl がある場所でビルドされ、それから別の場所に移されると、いくつかの 値は間違ったものになるかもしれません。 値は後から修正することすらできます。 =head2 Unix =begin original Perl works on a bewildering variety of Unix and Unix-like platforms (see e.g. most of the files in the F directory in the source code kit). On most of these systems, the value of C<$^O> (hence C<$Config{'osname'}>, too) is determined either by lowercasing and stripping punctuation from the first field of the string returned by typing C (or a similar command) at the shell prompt or by testing the file system for the presence of uniquely named files such as a kernel or header file. Here, for example, are a few of the more popular Unix flavors: =end original Perl は驚くほど色々な Unix と Unix 風プラットフォームで動作します (例えば ソースコードキットの F ディレクトリのほとんどのファイルを 参照してください)。 これらのシステムのほとんどでは、C<$^O> の値は (従って C<$Config{'osname'}> の値も)、シェルプロンプトから C (または 似たようなコマンド) で返された文字列の最初のフィールドから句読点を 取り除いて小文字にしたものか、カーネルやヘッダファイルのようなユニークな 名前の付いたファイルの存在をファイルシステムで調べることによって 決定されます。 例えば、以下はより有名な Unix 風システムのいくつかです: uname $^O $Config{'archname'} -------------------------------------------- AIX aix aix BSD/OS bsdos i386-bsdos Darwin darwin darwin DYNIX/ptx dynixptx i386-dynixptx FreeBSD freebsd freebsd-i386 Haiku haiku BePC-haiku Linux linux arm-linux Linux linux armv5tel-linux Linux linux i386-linux Linux linux i586-linux Linux linux ppc-linux HP-UX hpux PA-RISC1.1 IRIX irix irix Mac OS X darwin darwin NeXT 3 next next-fat NeXT 4 next OPENSTEP-Mach openbsd openbsd i386-openbsd OSF1 dec_osf alpha-dec_osf reliantunix-n svr4 RM400-svr4 SCO_SV sco_sv i386-sco_sv SINIX-N svr4 RM400-svr4 sn4609 unicos CRAY_C90-unicos sn6521 unicosmk t3e-unicosmk sn9617 unicos CRAY_J90-unicos SunOS solaris sun4-solaris SunOS solaris i86pc-solaris SunOS4 sunos sun4-sunos =begin original Because the value of C<$Config{archname}> may depend on the hardware architecture, it can vary more than the value of C<$^O>. =end original C<$Config{archname}> の値はハードウェアアーキテクチャに依存しているため、 C<$^O> の値よりも様々な値になります。 =head2 DOS and Derivatives (DOS とその派生) =begin original Perl has long been ported to Intel-style microcomputers running under systems like PC-DOS, MS-DOS, OS/2, and most Windows platforms you can bring yourself to mention (except for Windows CE, if you count that). Users familiar with I or I style shells should be aware that each of these file specifications may have subtle differences: =end original Perl は昔から Intel 形式のマイクロコンピュータで動作する PC-DOS, MS-DOS, OS/2 のようなシステムと、あなたが指摘できるようなほとんど全ての Windows プラットフォーム(もし Windows CE を含めるなら、これは除きます)に 移植されてきました。 I や I 形式のシェルになれているユーザーは、 以下のようなファイル指定に少しずつ違いがあることに気がつくはずです: my $filespec0 = "c:/foo/bar/file.txt"; my $filespec1 = "c:\\foo\\bar\\file.txt"; my $filespec2 = 'c:\foo\bar\file.txt'; my $filespec3 = 'c:\\foo\\bar\\file.txt'; =begin original System calls accept either C or C<\> as the path separator. However, many command-line utilities of DOS vintage treat C as the option prefix, so may get confused by filenames containing C. Aside from calling any external programs, C will work just fine, and probably better, as it is more consistent with popular usage, and avoids the problem of remembering what to backwhack and what not to. =end original システムコールはパス区切りとして C または C<\> のどちらかを受け付けます。 しかし、古い DOS のコマンドラインユーティリティは C をオプションの 接頭辞として扱うので、ファイル名に C が含まれていると混乱するかも しれません。 外部プログラムを呼び出すことを除いて、C はとてもうまく動作し、おそらく よりよいです; なぜなら一般的な使用法でより一貫性があって、何が バックスラッシュで何が層でないかを覚えるという問題を避けられます。 =begin original The DOS FAT filesystem can accommodate only "8.3" style filenames. Under the "case-insensitive, but case-preserving" HPFS (OS/2) and NTFS (NT) filesystems you may have to be careful about case returned with functions like C or used with functions like C or C. =end original DOS FAT ファイルシステムは "8.3" 形式のファイル名にのみ対応しています。 「大文字小文字を無視するが、保存する」HPFS (OS/2) と NTFS (NT) ファイルシステムでは C のような関数から返されたり、C や C のような関数で使う大文字小文字に注意する必要が あるかもしれません。 =begin original DOS also treats several filenames as special, such as AUX, PRN, NUL, CON, COM1, LPT1, LPT2, etc. Unfortunately, sometimes these filenames won't even work if you include an explicit directory prefix. It is best to avoid such filenames, if you want your code to be portable to DOS and its derivatives. It's hard to know what these all are, unfortunately. =end original DOS はまた、AUX, PRN, NUL, CON, COM1, LPT1, LPT2 のようないくつかの ファイル名を特別に扱います。 残念ながら、ときどきこれらのファイル名は明示的なディレクトリ接頭辞に 含んでいても動作しません。 コードに DOS とその派生で移植性があるようにするには、これらのファイル名を 避けるのが最良です。 残念ながら、これら全てを知るのは難しいです。 =begin original Users of these operating systems may also wish to make use of scripts such as I or I to put wrappers around your scripts. =end original これらのオペレーティングシステムのユーザーは、スクリプトのラッパーとして I や I のようなスクリプトを使いたいかもしれません。 =begin original Newline (C<\n>) is translated as C<\015\012> by STDIO when reading from and writing to files (see L<"Newlines">). C will keep C<\n> translated as C<\012> for that filehandle. Since it is a no-op on other systems, C should be used for cross-platform code that deals with binary data. That's assuming you realize in advance that your data is in binary. General-purpose programs should often assume nothing about their data. =end original ファイルから読み書きするとき、改行 (C<\n>) は STDIO によって C<\015\012> に 変換されます(L<"Newlines"> を参照してください)。 C は、このファイルハンドルに対して C<\n> を C<\012> として変換されます。 これはその他のシステムでは何もしないので、バイナリデータを扱う クロスプラットフォームコードでは C を使うべきです。 これは、予めデータがバイナリであることが分かっていることを仮定しています。 汎用プログラムはデータについて何も仮定しないべきです。 =begin original The C<$^O> variable and the C<$Config{archname}> values for various DOSish perls are as follows: =end original 様々な DOS 的な perl での C<$^O> 変数と C<$Config{archname}> の値は 以下の通りです: OS $^O $Config{archname} ID Version -------------------------------------------------------- MS-DOS dos ? PC-DOS dos ? OS/2 os2 ? Windows 3.1 ? ? 0 3 01 Windows 95 MSWin32 MSWin32-x86 1 4 00 Windows 98 MSWin32 MSWin32-x86 1 4 10 Windows ME MSWin32 MSWin32-x86 1 ? Windows NT MSWin32 MSWin32-x86 2 4 xx Windows NT MSWin32 MSWin32-ALPHA 2 4 xx Windows NT MSWin32 MSWin32-ppc 2 4 xx Windows 2000 MSWin32 MSWin32-x86 2 5 00 Windows XP MSWin32 MSWin32-x86 2 5 01 Windows 2003 MSWin32 MSWin32-x86 2 5 02 Windows Vista MSWin32 MSWin32-x86 2 6 00 Windows 7 MSWin32 MSWin32-x86 2 6 01 Windows 7 MSWin32 MSWin32-x64 2 6 01 Windows 2008 MSWin32 MSWin32-x86 2 6 01 Windows 2008 MSWin32 MSWin32-x64 2 6 01 Windows CE MSWin32 ? 3 Cygwin cygwin cygwin =begin original The various MSWin32 Perl's can distinguish the OS they are running on via the value of the fifth element of the list returned from C. For example: =end original 様々な MSWin32 Perl は、C から返されるリストの 5 番目の 要素の値を使って動作している OS を区別できます。 例えば: if ($^O eq 'MSWin32') { my @os_version_info = Win32::GetOSVersion(); print +('3.1','95','NT')[$os_version_info[4]],"\n"; } =begin original There are also C and C; try C, and as of libwin32 0.19 (not part of the core Perl distribution) C. The very portable C will work too: =end original また C と C もあります; C を 試してみてください; そして libwin32 0.19 (コア Perl 配布の一部では ありません) からは C があります。 とても移植性のある C も動作します: c:\> perl -MPOSIX -we "print join '|', uname" Windows NT|moonru|5.0|Build 2195 (Service Pack 2)|x86 =begin original Also see: =end original 以下も参照してください: =over 4 =item * =begin original The djgpp environment for DOS, L and L. =end original DOS のための djgpp 環境 L と L。 =item * =begin original The EMX environment for DOS, OS/2, etc. emx@iaehv.nl, L Also L. =end original DOS, OS/2 のための EMX 環境 emx@iaehv.nl, L および L。 =item * =begin original Build instructions for Win32 in L, or under the Cygnus environment in L. =end original L にある Win32 のためのビルド手順および L にある Cygnus 環境。 =item * =begin original The C modules in L. =end original L の C モジュール。 =item * =begin original The ActiveState Pages, L =end original ActiveState のページ, L =item * =begin original The Cygwin environment for Win32; F (installed as L), L =end original Win32 のための Cygwin 環境; F (L として インストールされます), L =item * =begin original The U/WIN environment for Win32, L =end original Win32 のための U/WIN 環境 L =item * =begin original Build instructions for OS/2, L =end original OS/2 のためのビルド手順である L =back =head2 VMS =begin original Perl on VMS is discussed in L in the Perl distribution. =end original VMS での Perl は Perl 配布の L で議論されています。 =begin original The official name of VMS as of this writing is OpenVMS. =end original これを書いている時点での VMS の正式名称は OpenVMS です。 =begin original Interacting with Perl from the Digital Command Language (DCL) shell often requires a different set of quotation marks than Unix shells do. For example: =end original Perl と Digital Command Language (DCL) シェルとの相互作用はしばしば Unix シェルが行うのと異なるクォートの種類が必要になります。 例えば: $ perl -e "print ""Hello, world.\n""" Hello, world. =begin original There are several ways to wrap your Perl scripts in DCL F<.COM> files, if you are so inclined. For example: =end original もしそうしたいなら、DCL F<.COM> ファイルに Perl スクリプトをラップする いくつかの方法があります。 例えば: $ write sys$output "Hello from DCL!" $ if p1 .eqs. "" $ then perl -x 'f$environment("PROCEDURE") $ else perl -x - 'p1 'p2 'p3 'p4 'p5 'p6 'p7 'p8 $ deck/dollars="__END__" #!/usr/bin/perl print "Hello from Perl!\n"; __END__ $ endif =begin original Do take care with C<$ ASSIGN/nolog/user SYS$COMMAND: SYS$INPUT> if your Perl-in-DCL script expects to do things like C<< $read = ; >>. =end original Perl-in-DCL スクリプトで C<< $read = ; >> のようなことを することを想定しているなら、C<$ ASSIGN/nolog/user SYS$COMMAND: SYS$INPUT> に 注意してください。 =begin original The VMS operating system has two filesystems, designated by their on-disk structure (ODS) level: ODS-2 and its successor ODS-5. The initial port of Perl to VMS pre-dates ODS-5, but all current testing and development assumes ODS-5 and its capabilities, including case preservation, extended characters in filespecs, and names up to 8192 bytes long. =end original VMS オペレーティングシステムには、on-disk structure (ODS) レベルによって 指定された二つのファイルシステムがあります: ODS-2 とその後継の ODS-5 です。 Perl から VMS への初期移植は ODS-5 以前の時代でしたが、 現在の全てのテストと開発は、大文字小文字の保存、filespecs の拡張文字、 8192 バイトまでの名前のような、ODS-5 とその性能を仮定しています。 =begin original Perl on VMS can accept either VMS- or Unix-style file specifications as in either of the following: =end original VMS での Perl は、 VMS 形式と Unix 形式のファイル指定の両方を、 以下のどちらかの形でも受け付けます: $ perl -ne "print if /perl_setup/i" SYS$LOGIN:LOGIN.COM $ perl -ne "print if /perl_setup/i" /sys$login/login.com =begin original but not a mixture of both as in: =end original しかし以下のように両方を混ぜることはできません: $ perl -ne "print if /perl_setup/i" sys$login:/login.com Can't open sys$login:/login.com: file specification syntax error =begin original In general, the easiest path to portability is always to specify filenames in Unix format unless they will need to be processed by native commands or utilities. Because of this latter consideration, the File::Spec module by default returns native format specifications regardless of input format. This default may be reversed so that filenames are always reported in Unix format by specifying the C feature logical in the environment. =end original 一般的に、最も簡単な移植性のあるパスは、ネイティブなコマンドや ユーティリティで処理する必要がない限り、 常に Unix 型式でファイル名を指定することです。 後者を考慮して、 File::Spec モジュールはデフォルトでは入力形式に関わらず ネイティブなフォーマット仕様を返します。 このデフォルトは、環境で C 機能論理を 指定することで、常に Unix 型式でファイル名を報告するように変更できます。 =begin original The file type, or extension, is always present in a VMS-format file specification even if it's zero-length. This means that, by default, C will return a trailing dot on a file with no extension, so where you would see C<"a"> on Unix you'll see C<"a."> on VMS. However, the trailing dot may be suppressed by enabling the C feature in the environment (see the CRTL documentation on feature logical names). =end original ファイル型(拡張子)は、(例え長さ 0 でも)VMS フォーマットファイル仕様では 常に存在します。 これは、デフォルトでは、C は拡張子のないファイルに対して末尾の ピリオドを返し、Unix で C<"a"> に見えるものが VMS では C<"a."> に 見えることを意味します。 しかし、環境で C 機能を有効にすることで、 末尾のドットを省略できます (機能論理名については CRTL 文書を参照してください)。 =begin original What C<\n> represents depends on the type of file opened. It usually represents C<\012> but it could also be C<\015>, C<\012>, C<\015\012>, C<\000>, C<\040>, or nothing depending on the file organization and record format. The C module provides access to the special C requirements of files with unusual attributes on VMS. =end original C<\n> が表現しているものはファイルを開く種類に依存します。 普通は C<\012> を表現しますが、ファイルの構成や記録形式に依存して C<\015>, C<\012>, C<\015\012>, C<\000>, C<\040> あるいは 何もなしかもしれません。 C モジュールは VMS での普通でない属性付きのファイルの 特殊な C へのアクセスを提供します。 =begin original The value of C<$^O> on OpenVMS is "VMS". To determine the architecture that you are running on refer to C<$Config{'archname'}>. =end original OpenVMS での C<$^O> の値は "VMS" です。 実行しているアーキテクチャを決定するには、C<$Config{'archname'}> を 参照します。 =begin original On VMS, perl determines the UTC offset from the C logical name. Although the VMS epoch began at 17-NOV-1858 00:00:00.00, calls to C are adjusted to count offsets from 01-JAN-1970 00:00:00.00, just like Unix. =end original VMS では、perl は UTC オフセットを C 論理名から 決定します。 VMS の紀元は 17-NOV-1858 00:00:00.00 に始まりますが、C の呼び出しは Unix と同様 01-JAN-1970 00:00:00.00 からのオフセットに調整されます。 =begin original Also see: =end original 以下も参照してください: =over 4 =item * =begin original F (installed as F), L =end original F (F としてインストールされます), L =item * =begin original vmsperl list, vmsperl-subscribe@perl.org =end original vmsperl メーリングリスト: vmsperl-subscribe@perl.org =item * =begin original vmsperl on the web, L =end original web 上の vmsperl: L =item * =begin original VMS Software Inc. web site, L =end original VMS Software Inc. web サイト, L =back =head2 VOS =begin original Perl on VOS (also known as OpenVOS) is discussed in F in the Perl distribution (installed as L). Perl on VOS can accept either VOS- or Unix-style file specifications as in either of the following: =end original VOS (OpenVOS としても知られます) での Perl は Perl 配布の F (L としてインストールされます) で議論されています。 VOS での Perl は、以下のどちらかのようにして、VOS 形式と Unix 形式のどちらのファイル指定も受け付けます: $ perl -ne "print if /perl_setup/i" >system>notices $ perl -ne "print if /perl_setup/i" /system/notices =begin original or even a mixture of both as in: =end original あるいは両方を混ぜて: $ perl -ne "print if /perl_setup/i" >system/notices =begin original Even though VOS allows the slash character to appear in object names, because the VOS port of Perl interprets it as a pathname delimiting character, VOS files, directories, or links whose names contain a slash character cannot be processed. Such files must be renamed before they can be processed by Perl. =end original VOS はオブジェクト名としてスラッシュ文字が現れることを許していますが、 VOS 版の Perl インタプリタはこれをパス名を分割する文字として解釈するので、 名前にスラッシュ文字を含む VOS ファイル、ディレクトリ、リンクは 処理できません。 このようなファイルは Perl によって処理される前に リネームされなければなりません。 =begin original Older releases of VOS (prior to OpenVOS Release 17.0) limit file names to 32 or fewer characters, prohibit file names from starting with a C<-> character, and prohibit file names from containing any character matching C<< tr/ !#%&'()*;<=>?// >>. =end original 古いリリースのVOS(OpenVOS リリース 17.0 以前) ではファイル名を 32 文字 以下に制限していたり、ファイル名を C<-> 文字で始められなかったり、 C<< tr/ !#%&'()*;<=>?// >> にマッチングする文字を含むことができないという 制限があります。 =begin original Newer releases of VOS (OpenVOS Release 17.0 or later) support a feature known as extended names. On these releases, file names can contain up to 255 characters, are prohibited from starting with a C<-> character, and the set of prohibited characters is reduced to any character matching C<< tr/#%*<>?// >>. There are restrictions involving spaces and apostrophes: these characters must not begin or end a name, nor can they immediately precede or follow a period. Additionally, a space must not immediately precede another space or hyphen. Specifically, the following character combinations are prohibited: space-space, space-hyphen, period-space, space-period, period-apostrophe, apostrophe-period, leading or trailing space, and leading or trailing apostrophe. Although an extended file name is limited to 255 characters, a path name is still limited to 256 characters. =end original より新しい VOS (OpenVOS リリース 17.0 以降) は拡張名として知られる機能に 対応しています。 これらのリリースでは、ファイル名は 255 文字までで、C<-> 文字で始めることは 禁止され、禁止される文字は C<< tr/#%*<>?// >> でマッチングするものに 減少しました。 スペースとアポストロフィに関する制限があります: これらの文字は名前の 先頭や末尾、ピリオドの直前や直後には使えません。 更に、スペースはその他のスペースやハイフンの前には使えません。 特に、以下のような文字の組み合わせは禁止されます: スペース-スペース、 スペース-ハイフン、ピリオド-スペース、スペース-ピリオド、 ピリオド-アポストロフィ、アポストロフィ-ピリオド、先頭または末尾のスペース、 先頭または末尾のアポストロフィ。 拡張ファイル名は 255 文字に制限されていますが、パス名は 256 文字に 制限されたままです。 =begin original The value of C<$^O> on VOS is "vos". To determine the architecture that you are running on without resorting to loading all of C<%Config> you can examine the content of the C<@INC> array like so: =end original VOS での C<$^O> の値は "vos" です。 C<%Config> を全て読み込むという手段を使わずに実行しているアーキテクチャを 決定するには、以下のようにして C<@INC> 配列の中身を確認します: if ($^O =~ /vos/) { print "I'm on a Stratus box!\n"; } else { print "I'm not on a Stratus box!\n"; die; } =begin original Also see: =end original 以下も参照してください: =over 4 =item * =begin original F (installed as L) =end original F (L としてインストールされます) =item * =begin original The VOS mailing list. =end original VOS メーリングリスト。 =begin original There is no specific mailing list for Perl on VOS. You can contact the Stratus Technologies Customer Assistance Center (CAC) for your region, or you can use the contact information located in the distribution files on the Stratus Anonymous FTP site. =end original VOS での Perl 専用のメーリングリストはありません。 あなたの地域の Stratus Technologies Customer Assistance Center (CAC) に 連絡を取るか、Stratus Anonymous FTP サイトの配布ファイルにある連絡情報を 使ってください。 =item * =begin original Stratus Technologies on the web at L =end original L にある Stratus Technologies の web サイト =item * =begin original VOS Open-Source Software on the web at L =end original L にある VOS Open-Source Software の web サイト =back =head2 EBCDIC Platforms (EBCDIC プラットフォーム) =begin original v5.22 core Perl runs on z/OS (formerly OS/390). Theoretically it could run on the successors of OS/400 on AS/400 minicomputers as well as VM/ESA, and BS2000 for S/390 Mainframes. Such computers use EBCDIC character sets internally (usually Character Code Set ID 0037 for OS/400 and either 1047 or POSIX-BC for S/390 systems). =end original v5.22 コア Perl は z/OS (以前は OS/390) で実行されます。 理論的には、AS/400 ミニコンピュータでの OS/400 の後継、 S/390 メインフレームでの VM/ESA, BS2000 のようなプラットフォームに 移植されています。 このようなコンピュータは内部で EBCDIC 文字集合 (通常は OS/400 では Character Code Set ID 0037、S/390 では 1047 または POSIX-BC の どちらか) を内部で使います。 =begin original The rest of this section may need updating, but we don't know what it should say. Please email comments to L. =end original この章の残りの部分は更新する必要がありますが、私たちはどうすれば良いか 分かっていません。 L に電子メールでコメントを送ってください。 =begin original On the mainframe Perl currently works under the "Unix system services for OS/390" (formerly known as OpenEdition), VM/ESA OpenEdition, or the BS200 POSIX-BC system (BS2000 is supported in Perl 5.6 and greater). See L for details. Note that for OS/400 there is also a port of Perl 5.8.1/5.10.0 or later to the PASE which is ASCII-based (as opposed to ILE which is EBCDIC-based), see L. =end original メインフレーム Perl は現在のところ "Unix system services for OS/390" (以前は OpenEdition として知られていたもの), VM/ESA OpenEdition, BS200 POSIX-BC システムで動作します (BS2000 は Perl 5.6 以降で対応します)。 詳しくは L を参照してください。 OS/400 には (EBCDIC ベースの ILE ではなく) ASCII ベースの PASE への Perl 5.8.1/5.10.0 以降の移植もあることに注意してください; L を 参照してください。 =begin original As of R2.5 of USS for OS/390 and Version 2.3 of VM/ESA these Unix sub-systems do not support the C<#!> shebang trick for script invocation. Hence, on OS/390 and VM/ESA Perl scripts can be executed with a header similar to the following simple script: =end original OS/390 の USS の R2.5 および VM/ESA のバージョン 2.3 以降、 これらの Unix 副システムはスクリプトの起動のための C<#!> トリックに 対応しなくなりました。 従って、OS/390 と VM/ESA では Perl スクリプトは以下のような単純な スクリプトと似たヘッダ付きで実行できます: : # use perl eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}' if 0; #!/usr/local/bin/perl # just a comment really print "Hello from perl!\n"; =begin original OS/390 will support the C<#!> shebang trick in release 2.8 and beyond. Calls to C and backticks can use POSIX shell syntax on all S/390 systems. =end original OS/390 はリリース 2.8 以降、C<#!> トリックに対応しています。 C と逆クォートの呼び出しは全ての S/390 システムで POSIX シェル文法を 使います。 =begin original On the AS/400, if PERL5 is in your library list, you may need to wrap your Perl scripts in a CL procedure to invoke them like so: =end original AS/400 では、ライブラリリストに PERL5 があれば、以下のようにして CL 手続きで Perl スクリプトをラップする必要があります: BEGIN CALL PGM(PERL5/PERL) PARM('/QOpenSys/hello.pl') ENDPGM =begin original This will invoke the Perl script F in the root of the QOpenSys file system. On the AS/400 calls to C or backticks must use CL syntax. =end original これは QOpenSys ファイルシステムのルートにある Perl スクリプト F を起動します。 AS/400 では C や逆クォートの呼び出しは CL 文法を 使わなければなりません。 =begin original On these platforms, bear in mind that the EBCDIC character set may have an effect on what happens with some Perl functions (such as C, C, C, C, C, C, C, C), as well as bit-fiddling with ASCII constants using operators like C<^>, C<&> and C<|>, not to mention dealing with socket interfaces to ASCII computers (see L<"Newlines">). =end original これらのプラットフォームでは、(C, C, C, C, C, C, C, C のような) 一部の Perl の関数および、C<^>, C<&>, C<|> のような演算子を使った ASCII 定数のビット操作での効果が EBCDIC 文字では異なることがあることに 注意してください; ASCII コンピュータへのソケットインターフェースを 扱うことを言及しません (L<"Newlines"> 参照)。 =begin original Fortunately, most web servers for the mainframe will correctly translate the C<\n> in the following statement to its ASCII equivalent (C<\r> is the same under both Unix and z/OS): =end original 幸いにも、メインフレームのほとんどの web サーバは以下の文の C<\n> を ASCII の等価物に正しく変換します (C<\r> は Unix と z/OS で同じです): print "Content-type: text/html\r\n\r\n"; =begin original The values of C<$^O> on some of these platforms includes: =end original これらのプラットフォームの C<$^O> の値は以下のようなものです: uname $^O $Config{'archname'} -------------------------------------------- OS/390 os390 os390 OS400 os400 os400 POSIX-BC posix-bc BS2000-posix-bc =begin original Some simple tricks for determining if you are running on an EBCDIC platform could include any of the following (perhaps all): =end original EBCDIC プラットフォームで実行されているかどうかを決定するための 単純なトリックとしては、以下のどれか(おそらく全て)があります: if ("\t" eq "\005") { print "EBCDIC may be spoken here!\n"; } if (ord('A') == 193) { print "EBCDIC may be spoken here!\n"; } if (chr(169) eq 'z') { print "EBCDIC may be spoken here!\n"; } =begin original One thing you may not want to rely on is the EBCDIC encoding of punctuation characters since these may differ from code page to code page (and once your module or script is rumoured to work with EBCDIC, folks will want it to work with all EBCDIC character sets). =end original 依存したいと思わないだろうことの一つは、句読点文字の EBCDIC エンコードでしょう; これらはコードページによって異なるからです (そして一旦あなたのモジュールやスクリプトが EBCDIC で動作すると噂されると、 人々は全ての EBCDIC 文字集合で動作することを求めます)。 =begin original Also see: =end original 以下も参照してください: =over 4 =item * L, L, L, L. =item * =begin original The perl-mvs@perl.org list is for discussion of porting issues as well as general usage issues for all EBCDIC Perls. Send a message body of "subscribe perl-mvs" to majordomo@perl.org. =end original perl-mvs@perl.org メーリングリストは移植の問題および全ての EBCDIC Perl に 関する一般的な使用法について議論するための物です。 メッセージ本体に "subscribe perl-mvs" と書いて majordomo@perl.org に 送ってください。 =item * =begin original AS/400 Perl information at L as well as on CPAN in the F directory. =end original L の AS/400 Perl 情報および CPAN の F ディレクトリ。 =back =head2 Acorn RISC OS =begin original Because Acorns use ASCII with newlines (C<\n>) in text files as C<\012> like Unix, and because Unix filename emulation is turned on by default, most simple scripts will probably work "out of the box". The native filesystem is modular, and individual filesystems are free to be case-sensitive or insensitive, and are usually case-preserving. Some native filesystems have name length limits, which file and directory names are silently truncated to fit. Scripts should be aware that the standard filesystem currently has a name length limit of B<10> characters, with up to 77 items in a directory, but other filesystems may not impose such limitations. =end original Acorns は Unix と同様 ASCII を使い、テキストファイルの改行 (C<\n>) に C<\012> を使うのと、Unix ファイル名エミュレーションがデフォルトで 有効なので、ほとんどの単純なスクリプトはおそらく「そのまま」で動作します。 ネイティブなファイルシステムはモジュラー形式で、個々のファイルシステムは 大文字小文字を区別するかしないかは関係なく、普通は大文字小文字を保存します。 ネイティブなファイルシステムの一部は名前の長さに制限があり、 ファイル名とディレクトリ名は収まるように暗黙に切り詰められます。 スクリプトは、標準ファイルシステムは名前の長さが B<10> に制限され、一つの ディレクトリに77 アイテムまでに制限されることに注意するべきです; しかし他のファイルシステムはこのような制限はないかもしれません。 =begin original Native filenames are of the form =end original ネイティブなファイル名は以下の形式です: Filesystem#Special_Field::DiskName.$.Directory.Directory.File =begin original where =end original それぞれは以下の通りです: Special_Field is not usually present, but may contain . and $ . Filesystem =~ m|[A-Za-z0-9_]| DsicName =~ m|[A-Za-z0-9_/]| $ represents the root directory . is the path separator @ is the current directory (per filesystem but machine global) ^ is the parent directory Directory and File =~ m|[^\0- "\.\$\%\&:\@\\^\|\177]+| =begin original The default filename translation is roughly C =end original デフォルトファイル名変換はだいたい C です。 =begin original Note that C<"ADFS::HardDisk.$.File" ne 'ADFS::HardDisk.$.File'> and that the second stage of C<$> interpolation in regular expressions will fall foul of the C<$.> if scripts are not careful. =end original C<"ADFS::HardDisk.$.File" ne 'ADFS::HardDisk.$.File'> と、正規表現中の C<$> 展開の第 2 ステージは、スクリプトが注意深くなければ C<$.> を 落とすことに注意してください。 =begin original Logical paths specified by system variables containing comma-separated search lists are also allowed; hence C is a valid filename, and the filesystem will prefix C with each section of C until a name is made that points to an object on disk. Writing to a new file C would be allowed only if C contains a single item list. The filesystem will also expand system variables in filenames if enclosed in angle brackets, so C<< .Modules >> would look for the file S>. The obvious implication of this is that B >>> and should be protected when C is used for input. =end original カンマ区切りの検索リストを含むシステム変数で指定された論理パスも使えます; 従って C は妥当なファイル名で、 ファイルシステムは、名前がディスク上のオブジェクトを指すようになるまで C のそれぞれの部分に C を前置します。 C に単一のアイテムリストが含まれている場合にのみ、 新しいファイル C に書き込めます。 ファイルシステムはファイル名にシステム変数が角かっこで囲まれていると 展開するので、 C<< .Modules >> は S> というファイルを探します。 ここから明らかに推測されることは、 B<完全修飾ファイル名は C<< <> >> で始まることがあり>、C が 入力で使われるときは保護されるべきということです。 =begin original Because C<.> was in use as a directory separator and filenames could not be assumed to be unique after 10 characters, Acorn implemented the C compiler to strip the trailing C<.c> C<.h> C<.s> and C<.o> suffix from filenames specified in source code and store the respective files in subdirectories named after the suffix. Hence files are translated: =end original C<.> がディレクトリセパレータとして使われていて、ファイル名の 10 文字目 以降はユニークであると仮定できないので、Acorn はソースコード中に指定された ファイル名から末尾の C<.c> C<.h> C<.s>, C<.o> 拡張子を切り落として、 拡張子の名前のサブディレクトリにそれぞれのファイルを保管するような形で C コンパイラを実装しました。 従ってファイルは変換されます: foo.h h.foo C:foo.h C:h.foo (logical path variable) sys/os.h sys.h.os (C compiler groks Unix-speak) 10charname.c c.10charname 10charname.o o.10charname 11charname_.c c.11charname (assuming filesystem truncates at 10) =begin original The Unix emulation library's translation of filenames to native assumes that this sort of translation is required, and it allows a user-defined list of known suffixes that it will transpose in this fashion. This may seem transparent, but consider that with these rules F and F both map to F, and that C and C cannot and do not attempt to emulate the reverse mapping. Other C<.>'s in filenames are translated to C. =end original Unix エミュレーションライブラリのファイル名のネイティブへの変換は この種の変換が必要であることを仮定していて、この方法で入れ替える既知の 拡張子のリストをユーザー定義できるようになっています。 これは透過的に思えますが、これらの規則では F と F の両方が F にマッピングされ、C と C は逆マッピングのエミュレートを試みることができないことを 考慮してください。 ファイル名中のその他の C<.> は C に変換されます。 =begin original As implied above, the environment accessed through C<%ENV> is global, and the convention is that program specific environment variables are of the form C. Each filesystem maintains a current directory, and the current filesystem's current directory is the B current directory. Consequently, sociable programs don't change the current directory but rely on full pathnames, and programs (and Makefiles) cannot assume that they can spawn a child process which can change the current directory without affecting its parent (and everyone else for that matter). =end original すでに暗示したように、C<%ENV> を通してアクセスする環境はグローバルで、 プログラム固有環境変数は C の形に変換されます。 それぞれのファイルシステムはカレントディレクトリを管理し、現在の ファイルシステムのカレントディレクトリは B<グローバルな> カレントディレクトリです。 従って、社交的なプログラムはカレントディレクトリを変更せずに フルパス名に頼り、プログラム(および Makefile) は親 (およびこの意味では その他あらゆるもの)に影響を与えずにカレントディレクトリを変更できる 子プロセスを作成できると仮定できません。 =begin original Because native operating system filehandles are global and are currently allocated down from 255, with 0 being a reserved value, the Unix emulation library emulates Unix filehandles. Consequently, you can't rely on passing C, C, or C to your children. =end original ネイティブオペレーティングシステムファイルハンドルはグローバルで 現在のところ 255 から下向きに割り当てられ、0 は予約された値なので、 Unix エミュレーションライブラリは Unix ファイルハンドルをエミュレートします。 従って、C, C, C を子プロセスに渡すことに 頼れません。 =begin original The desire of users to express filenames of the form C<< .Bar >> on the command line unquoted causes problems, too: C<``> command output capture has to perform a guessing game. It assumes that a string C<< <[^<>]+\$[^<>]> >> is a reference to an environment variable, whereas anything else involving C<< < >> or C<< > >> is redirection, and generally manages to be 99% right. Of course, the problem remains that scripts cannot rely on any Unix tools being available, or that any tools found have Unix-like command line arguments. =end original コマンドラインでクォートなしに C<< .Bar >> 形式のファイル名を 記述するというユーザーの欲求も問題を引き起こします: C<``> コマンド出力 捕捉は推論ゲームをする必要があります。 C<< <[^<>]+\$[^<>]> >> は環境変数の参照、それ以外の C<< < >> や C<< > >> が 関係する全てはリダイレクトと推測し、これは一般的に何とか 99% は正しいです。 もちろん、スクリプトはどの Unix ツールが利用可能であることや、見つけた ツールが Unix 風のコマンドライン引数を取ることには頼れないという問題は 残っています。 =begin original Extensions and XS are, in theory, buildable by anyone using free tools. In practice, many don't, as users of the Acorn platform are used to binary distributions. MakeMaker does run, but no available make currently copes with MakeMaker's makefiles; even if and when this should be fixed, the lack of a Unix-like shell will cause problems with makefile rules, especially lines of the form C, and anything using quoting. =end original エクステンションと XS は、理論的には、自由なツールを使って誰でも ビルドできます。 実際には、多くの人はできません; Acorn プラットフォームのユーザーは バイナリ配布を使っているからです。 MakeMaker は実行できますが、現在のところ MakeMaker の makefile を処理できる make はありません; たとえこれが修正されても、Unix 風シェルがないので makefile 規則で問題が起こります; 特に C 形式の行や、 クォートを使ったものです。 =begin original "S" is the proper name for the operating system, but the value in C<$^O> is "riscos" (because we don't like shouting). =end original "S" はオペレーティングシステムの適切な名前ですが、C<$^O> の値は "riscos" (大文字は好まないからです)。 =head2 Other perls (その他の perl) =begin original Perl has been ported to many platforms that do not fit into any of the categories listed above. Some, such as AmigaOS, QNX, Plan 9, and VOS, have been well-integrated into the standard Perl source code kit. You may need to see the F directory on CPAN for information, and possibly binaries, for the likes of: aos, Atari ST, lynxos, riscos, Novell Netware, Tandem Guardian, I (Yes, we know that some of these OSes may fall under the Unix category, but we are not a standards body.) =end original Perl は上述したカテゴリ一覧のどれにも当てはまらないような多くの プラットフォームに移植されています。 AmigaOS, QNX, Plan 9, VOS のような一部のものは標準 Perl ソースコードキットと よく統合されています。 Atari ST, lynxos, riscos, Novell Netware, Tandem Guardian I<など> の ようなものについての情報とおそらくバイナリを得るために CPAN の F ディレクトリを見る必要があるかもしれません: (はい、これらの OS の一部は Unix カテゴリに入ることを知っていますが、 私たちは標準の組織ではありません。) =begin original Some approximate operating system names and their C<$^O> values in the "OTHER" category include: =end original "OTHER" カテゴリにあるいくつかの近似オペレーティングシステム名と その C<$^O> の値は以下のようなものです: OS $^O $Config{'archname'} ------------------------------------------ Amiga DOS amigaos m68k-amigos =begin original See also: =end original 以下も参照してください: =over 4 =item * =begin original Amiga, F (installed as L). =end original Amiga, F (L としてインストールされます) =item * =begin original A free perl5-based PERL.NLM for Novell Netware is available in precompiled binary and source code form from L as well as from CPAN. =end original Novell Netware 用のフリーの perl5 ベースの PERL.NLM は、コンパイル済みの バイナリとソースコード形式が L および CPAN から 利用可能です。 =item * S, F =back =head1 FUNCTION IMPLEMENTATIONS (関数実装) =begin original Listed below are functions that are either completely unimplemented or else have been implemented differently on various platforms. Following each description will be, in parentheses, a list of platforms that the description applies to. =end original 以下の一覧は、プラットフォームによって全く実装されていないか、 さもなければ異なった形で実装されている関数です。 それぞれの記述にあるかっこは、記述が適用されるプラットフォームの一覧です。 =begin original The list may well be incomplete, or even wrong in some places. When in doubt, consult the platform-specific README files in the Perl source distribution, and any other documentation resources accompanying a given port. =end original 一覧は不完全であったり、一部で間違っている可能性があります。 疑わしいときは、Perl ソース配布のプラットフォーム固有の README ファイルや、 プラットフォームに関連するその他の文書リソースをチェックしてください。 =begin original Be aware, moreover, that even among Unix-ish systems there are variations. =end original さらに、Unix 風システムにもバリエーションがあることに注意してください。 =begin original For many functions, you can also query C<%Config>, exported by default from the C module. For example, to check whether the platform has the C call, check C<$Config{d_lstat}>. See L for a full description of available variables. =end original 多くの関数に関して、C モジュールからデフォルトでエクスポートされる C<%Config> に問い合わせることもできます。 例えば、プラットフォームに C 呼び出しがあるかどうかを調べるには、 C<$Config{d_lstat}> を調べてください。 利用可能な変数の完全な説明については L を参照してください。 =head2 Alphabetical Listing of Perl Functions (Perl 関数のアルファベット順リスト) =over 8 =item -X =begin original C<-w> only inspects the read-only file attribute (FILE_ATTRIBUTE_READONLY), which determines whether the directory can be deleted, not whether it can be written to. Directories always have read and write access unless denied by discretionary access control lists (DACLs). (S) =end original C<-w> は読み込み専用ファイル属性 (FILE_ATTRIBUTE_READONLY) のみを調べます; これはディレクトリに書き込めるかどうかではなくディレクトリが 削除できるかどうかを決定します。 ディレクトリは、随意アクセス制御リスト (DACL) で拒否されない限り、常に 読み書きアクセスできます。 (S) =begin original C<-r>, C<-w>, C<-x>, and C<-o> tell whether the file is accessible, which may not reflect UIC-based file protections. (VMS) =end original C<-r>, C<-w>, C<-x>, C<-o> はファイルがアクセス可能かどうかを返し、 UIC ベースのファイル保護を反映しません。 (VMS) =begin original C<-s> by name on an open file will return the space reserved on disk, rather than the current extent. C<-s> on an open filehandle returns the current size. (S) =end original 開いているファイルへの名前での C<-s> は、現在のエクステントではなく、 ディスク上に予約されている空間を返します。 開いているファイルハンドルへの C<-s> は現在のサイズを返します。 (S) =begin original C<-R>, C<-W>, C<-X>, C<-O> are indistinguishable from C<-r>, C<-w>, C<-x>, C<-o>. (Win32, VMS, S) =end original C<-R>, C<-W>, C<-X>, C<-O> は、C<-r>, C<-w>, C<-x>, C<-o> と 区別が付きません。 (Win32, VMS, S) =begin original C<-g>, C<-k>, C<-l>, C<-u>, C<-A> are not particularly meaningful. (Win32, VMS, S) =end original C<-g>, C<-k>, C<-l>, C<-u>, C<-A> は特に意味はありません。 (Win32, VMS, S) =begin original C<-p> is not particularly meaningful. (VMS, S) =end original C<-p> は特に意味はありません。 (VMS, S) =begin original C<-d> is true if passed a device spec without an explicit directory. (VMS) =end original C<-d> は、明示的なディレクトリなしに device spec を渡されると真になります。 (VMS) =begin original C<-x> (or C<-X>) determine if a file ends in one of the executable suffixes. C<-S> is meaningless. (Win32) =end original C<-x> (または C<-X>) はファイルが実行可能ファイルの拡張子のどれかで 終わっているかを判定します。 C<-S> は無意味です。 (Win32) =begin original C<-x> (or C<-X>) determine if a file has an executable file type. (S) =end original C<-x> (または C<-X>) ファイルが実行可能ファイル型かどうかを 決定します。 (S) =item alarm =begin original Emulated using timers that must be explicitly polled whenever Perl wants to dispatch "safe signals" and therefore cannot interrupt blocking system calls. (Win32) =end original Perl が「安全なシグナル」を発行したいタイミングで明示的に ポーリングされなければならないタイマーを使ってエミュレートされ、 従ってシステムコールのブロックに割り込めません。 (Win32) =item atan2 =begin original Due to issues with various CPUs, math libraries, compilers, and standards, results for C may vary depending on any combination of the above. Perl attempts to conform to the Open Group/IEEE standards for the results returned from C, but cannot force the issue if the system Perl is run on does not allow it. (Tru64, HP-UX 10.20) =end original 様々な CPU、数値演算ライブラリ、コンパイラ、標準の問題により、C の 結果は上述の組み合わせに依存して様々に異なります。 Perl は C から返される結果を Open Group/IEEE 標準に 準拠させようとしますが、システムの Perl がそれを許さないところで 動作している場合は問題を強制させることはできません。 (Tru64, HP-UX 10.20) =begin original The current version of the standards for C is available at L. =end original C の現在のバージョンの標準は L で 利用可能です。 =item binmode =begin original Meaningless. (S) =end original 無意味です。 (S) =begin original Reopens file and restores pointer; if function fails, underlying filehandle may be closed, or pointer may be in a different position. (VMS) =end original ファイルの再オープンとポインタの復帰; 関数が失敗すると、基となる ファイルハンドルが閉じられたり、ポインタが異なった位置を示すことが あります。 (VMS) =begin original The value returned by C may be affected after the call, and the filehandle may be flushed. (Win32) =end original C から返された値はこの呼び出しの後に影響を受けることがあり、 ファイルハンドルがフラッシュされることがあります。 (Win32) =item chmod =begin original Only good for changing "owner" read-write access, "group", and "other" bits are meaningless. (Win32) =end original 「所有者」読み書きアクセスの変更のみ動作し、「グループ」「その他」のビットは 無意味です。 (Win32) =begin original Only good for changing "owner" and "other" read-write access. (S) =end original 「所有者」と「その他」の読み書きアクセスの変更のみ動作します。 (S) =begin original Access permissions are mapped onto VOS access-control list changes. (VOS) =end original アクセス許可は VOS アクセス制御リスト変更に割り当てられます。 (VOS) =begin original The actual permissions set depend on the value of the C in the SYSTEM environment settings. (Cygwin) =end original 実際の許可は SYSTEM 環境設定の C の値に依存して設定されます。 (Cygwin) =begin original Setting the exec bit on some locations (generally F) will return true but not actually set the bit. (Android) =end original 一部の場所 (一般的には F) への実行ビットの設定は真を返しますが 実際にはビットは設定されません。 (Android) =item chown =begin original Not implemented. (Win32, S, S) =end original 実装されていません。 (Win32, S, S) =begin original Does nothing, but won't fail. (Win32) =end original 何もしませんが失敗もしません。 (Win32) =begin original A little funky, because VOS's notion of ownership is a little funky (VOS). =end original VOS での所有者の概念は少し変なので、少し変です。 (VOS) =item chroot =begin original Not implemented. (Win32, VMS, S, S, VOS) =end original 実装されていません。 (Win32, VMS, S, S, VOS) =item crypt =begin original May not be available if library or source was not provided when building perl. (Win32) =end original perl のビルド時にライブラリかソースが提供されていないと 利用できないかもしれません。 (Win32) =begin original Not implemented. (Android) =end original 実装されていません。 (Android) =item dbmclose =begin original Not implemented. (VMS, S, VOS) =end original 実装されていません。 (VMS, S, VOS) =item dbmopen =begin original Not implemented. (VMS, S, VOS) =end original 実装されていません。 (VMS, S, VOS) =item dump =begin original Not useful. (S) =end original 使い道はありません。 (S) =begin original Not supported. (Cygwin, Win32) =end original 対応していません。 (Cygwin, Win32) =begin original Invokes VMS debugger. (VMS) =end original VMS デバッガを起動します。 (VMS) =item exec =begin original C without the use of indirect object syntax (C) may fall back to trying the shell if the first C fails. (Win32) =end original 間接オブジェクト構文 (C) を使わない C は、 最初の C が失敗したときにシェルにフォールバックすることがあります。 (Win32) =begin original Does not automatically flush output handles on some platforms. (SunOS, Solaris, HP-UX) =end original 一部のプラットフォームでは出力ハンドルを自動的にフラッシュしません。 (SunOS, Solaris, HP-UX) =begin original Not supported. (Symbian OS) =end original 対応していません。 (Symbian OS) =item exit =begin original Emulates Unix C (which considers C to indicate an error) by mapping the C<1> to C (C<44>). This behavior may be overridden with the pragma C. As with the CRTL's C function, C is also mapped to an exit status of C (C<1>); this mapping cannot be overridden. Any other argument to C is used directly as Perl's exit status. On VMS, unless the future POSIX_EXIT mode is enabled, the exit code should always be a valid VMS exit code and not a generic number. When the POSIX_EXIT mode is enabled, a generic number will be encoded in a method compatible with the C library _POSIX_EXIT macro so that it can be decoded by other programs, particularly ones written in C, like the GNV package. (VMS) =end original C<1> を C (C<44>) にマッピングすることで Unix の (エラーを示すために C を使う) C をエミュレートします。 この振る舞いはプラグマ C で上書きされます。 CRTL の C 関数と同様、C は C の終了ステータス (C<1>) にマッピングされます; このマッピングは上書きできません。 C へのその他の引数は直接 Perl の終了ステータスとして使われます。 VMS では、将来の POSIX_EXIT モードが有効でない限り、終了コードは 常に有効な VMS 終了コードであり、一般的な数値ではないべきです。 POSIX_EXIT モードが有効なら、一般的な数値は C ライブラリの _POSIX_EXIT と 互換性のあるメソッドにエンコードされるので、その他のプログラム、特に GNV パッケージのような C で書かれているプログラムでデコードできます。 (VMS) =begin original C resets file pointers, which is a problem when called from a child process (created by C) in C. A workaround is to use C. (Solaris) =end original C はファイルポインタをリセットするので、C 内で (C によって作られた) 子プロセスから呼び出されたときに 問題になります。 回避方法は C を使うことです。 (Solaris) exit unless $Config{archname} =~ /\bsolaris\b/; require POSIX and POSIX::_exit(0); =item fcntl =begin original Not implemented. (Win32) =end original 実装されていません。 (Win32) =begin original Some functions available based on the version of VMS. (VMS) =end original 一部の関数は VMS 版を基として利用可能です。 (VMS) =item flock =begin original Not implemented (VMS, S, VOS). =end original 実装されていません。 (VMS, S, VOS) =item fork =begin original Not implemented. (AmigaOS, S, VMS) =end original 実装されていません。 (AmigaOS, S, VMS) =begin original Emulated using multiple interpreters. See L. (Win32) =end original 複数のインタプリタを使ってエミュレートされています。 L を参照してください。 (Win32) =begin original Does not automatically flush output handles on some platforms. (SunOS, Solaris, HP-UX) =end original 一部のプラットフォームでは出力ハンドルを自動的にフラッシュしません。 (SunOS, Solaris, HP-UX) =item getlogin =begin original Not implemented. (S) =end original 実装されていません。 (S) =item getpgrp =begin original Not implemented. (Win32, VMS, S) =end original 実装されていません。 (Win32, VMS, S) =item getppid =begin original Not implemented. (Win32, S) =end original 実装されていません。 (Win32, S) =item getpriority =begin original Not implemented. (Win32, VMS, S, VOS) =end original 実装されていません。 (Win32, VMS, S, VOS) =item getpwnam =begin original Not implemented. (Win32) =end original 実装されていません。 (Win32) =begin original Not useful. (S) =end original 使い道はありません。 (S) =item getgrnam =begin original Not implemented. (Win32, VMS, S) =end original 実装されていません。 (Win32, VMS, S) =item getnetbyname =begin original Not implemented. (Android, Win32, S) =end original 実装されていません。 (Android, Win32, S) =item getpwuid =begin original Not implemented. (Win32) =end original 実装されていません。 (Win32) =begin original Not useful. (S) =end original 使い道はありません。 (S) =item getgrgid =begin original Not implemented. (Win32, VMS, S) =end original 実装されていません。 (Win32, VMS, S) =item getnetbyaddr =begin original Not implemented. (Android, Win32, S) =end original 実装されていません。 (Android, Win32, S) =item getprotobynumber =begin original Not implemented. (Android) =end original 実装されていません。 (Android) =item getservbyport =item getpwent =begin original Not implemented. (Android, Win32) =end original 実装されていません。 (Android, Win32) =item getgrent =begin original Not implemented. (Android, Win32, VMS) =end original 実装されていません。 (Android, Win32, VMS) =item gethostbyname =begin original C does not work everywhere: you may have to use C. (S) =end original C はどこでも動作するわけではありません: C を使う必要があるかもしれません。 (S) =item gethostent =begin original Not implemented. (Win32) =end original 実装されていません。 (Win32) =item getnetent =begin original Not implemented. (Android, Win32, S) =end original 実装されていません。 (Android, Win32, S) =item getprotoent =begin original Not implemented. (Android, Win32, S) =end original 実装されていません。 (Android, Win32, S) =item getservent =begin original Not implemented. (Win32, S) =end original 実装されていません。 (Win32, S) =item seekdir =begin original Not implemented. (Android) =end original 実装されていません。 (Android) =item sethostent =begin original Not implemented. (Android, Win32, S, S) =end original 実装されていません。 (Android, Win32, S, S) =item setnetent =begin original Not implemented. (Win32, S, S) =end original 実装されていません。 (Win32, S, S) =item setprotoent =begin original Not implemented. (Android, Win32, S, S) =end original 実装されていません。 (Android, Win32, S, S) =item setservent =begin original Not implemented. (S, Win32, S) =end original 実装されていません。 (S, Win32, S) =item endpwent =begin original Not implemented. (Win32) =end original 実装されていません。 (Win32) =begin original Either not implemented or a no-op. (Android) =end original 実装されていないか何もしないかです。 (Android) =item endgrent =begin original Not implemented. (Android, S, VMS, Win32) =end original 実装されていません。 (Android, S, VMS, Win32) =item endhostent =begin original Not implemented. (Android, Win32) =end original 実装されていません。 (Android, Win32) =item endnetent =begin original Not implemented. (Android, Win32, S) =end original 実装されていません。 (Android, Win32, S) =item endprotoent =begin original Not implemented. (Android, Win32, S) =end original 実装されていません。 (Android, Win32, S) =item endservent =begin original Not implemented. (S, Win32) =end original 実装されていません。 (S, Win32) =item getsockopt SOCKET,LEVEL,OPTNAME =begin original Not implemented. (S) =end original 実装されていません。 (S) =item glob =begin original This operator is implemented via the C extension on most platforms. See L for portability information. =end original この演算子はほとんどのプラットフォームでは C エクステンションで 実装されています。 移植性の情報については L を参照してください。 =item gmtime =begin original In theory, C is reliable from -2**63 to 2**63-1. However, because work arounds in the implementation use floating point numbers, it will become inaccurate as the time gets larger. This is a bug and will be fixed in the future. =end original 理論的には、C は -2**63 から 2**63-1 の範囲で信頼性があります。 しかし、実装で浮動小数点数を使っているので、値が大きくなるにつれて 不正確になります。 これはバグで、詳細修正されます。 =begin original On VOS, time values are 32-bit quantities. =end original VOS では、時刻の値は 32-bit です。 =item ioctl FILEHANDLE,FUNCTION,SCALAR =begin original Not implemented. (VMS) =end original 実装されていません。 (VMS) =begin original Available only for socket handles, and it does what the C call in the Winsock API does. (Win32) =end original ソケットハンドルに対してのみ利用可能で、Winsock API の C 呼び出しですることをします。 (Win32) =begin original Available only for socket handles. (S) =end original ソケットハンドルに対してのみ利用可能です。 (S) =item kill =begin original Not implemented, hence not useful for taint checking. (S) =end original 汚染チェックには有用ではないので、実装されていません。 (S) =begin original C doesn't have the semantics of C, i.e. it doesn't send a signal to the identified process like it does on Unix platforms. Instead C terminates the process identified by C<$pid>, and makes it exit immediately with exit status $sig. As in Unix, if $sig is 0 and the specified process exists, it returns true without actually terminating it. (Win32) =end original C は C の動作はありません; つまり、 Unix プラットフォームで行われるように識別されたプロセスへシグナルを 送りません。 代わりに C は C<$pid> で識別されるプロセスを終了させ、 終了コード $sig で直ちに終了させます。 Unix でのように、$sig が 0 で指定されたプロセスが存在するなら、実際には 終了させずに真を返します。 (Win32) =begin original C will terminate the process specified by C<$pid> and recursively all child processes owned by it. This is different from the Unix semantics, where the signal will be delivered to all processes in the same process group as the process specified by $pid. (Win32) =end original C は C<$pid> で指定されたプロセスと、そのプロセスが 所有している全ての子プロセスを再帰的に終了させます。 これは、$pid で指定されたプロセスと同じプロセスグループの全ての プロセスにシグナルを送信する、という Unix での動作と異なります。 (Win32) =begin original A pid of -1 indicating all processes on the system is not currently supported. (VMS) =end original pid -1 でシステム上の全てのプロセスを示すというのは現在のところ 対応していません。 (VMS) =item link =begin original Not implemented. (S, VOS) =end original 実装されていません。 (S, VOS) =begin original Link count not updated because hard links are not quite that hard (They are sort of half-way between hard and soft links). (AmigaOS) =end original ハードリンクは完全にハードではないので、リンクカウントは更新されません (これはハードリンクとソフトリンクの中間のようなものです)。 (AmigaOS) =begin original Hard links are implemented on Win32 under NTFS only. They are natively supported on Windows 2000 and later. On Windows NT they are implemented using the Windows POSIX subsystem support and the Perl process will need Administrator or Backup Operator privileges to create hard links. =end original ハードリンクは NTFS の Win32 にのみ実装されています。 これは Windows 2000 以降でネイティブに対応しています。 Windows NT では Windows POSIX サブシステムサポートを使って 実装されていて、Perl プロセスはハードリンクを作るには Administrator または Backup Operator 権限が必要です。 =begin original Available on 64 bit OpenVMS 8.2 and later. (VMS) =end original 64 ビット OpenVMS 8.2 以降で利用可能です。 (VMS) =item localtime =begin original localtime() has the same range as L, but because time zone rules change its accuracy for historical and future times may degrade but usually by no more than an hour. =end original localtime() は L と同じ範囲を持ちます; しかしタイムゾーンの 変更により過去および未来の精度は劣化するかもしれませんが、普通は 1 時間以内です。 =item lstat =begin original Not implemented. (S) =end original 実装されていません。 (S) =begin original Return values (especially for device and inode) may be bogus. (Win32) =end original 返り値 (特にデバイスと i ノード) は偽物かもしれません。 (Win32) =item msgctl =item msgget =item msgsnd =item msgrcv =begin original Not implemented. (Android, Win32, VMS, S, S, VOS) =end original 実装されていません。 (Android, Win32, VMS, S, S, VOS) =item open =begin original open to C<|-> and C<-|> are unsupported. (Win32, S) =end original C<|-> と C<-|> へのオープンは対応していません。 (Win32, S) =begin original Opening a process does not automatically flush output handles on some platforms. (SunOS, Solaris, HP-UX) =end original プロセスをオープンしたときに一部のプラットフォームでは出力ハンドルを自動的に フラッシュしません。 (SunOS, Solaris, HP-UX) =item readlink =begin original Not implemented. (Win32, VMS, S) =end original 実装されていません。 (Win32, VMS, S) =item rename =begin original Can't move directories between directories on different logical volumes. (Win32) =end original 異なった論理ボリュームのディレクトリの間ではディレクトリは移動できません。 (Win32) =item rewinddir =begin original Will not cause C to re-read the directory stream. The entries already read before the C call will just be returned again from a cache buffer. (Win32) =end original ディレクトリストリームの再読み込みに C を行いません。 C 呼び出しの前に既に読み込まれているエントリは再び キャッシュバッファから返されます。 (Win32) =item select =begin original Only implemented on sockets. (Win32, VMS) =end original ソケットに対してのみ実装されています。 (Win32, VMS) =begin original Only reliable on sockets. (S) =end original ソケットに対してのみ信頼できます。 (S) =begin original Note that the C 形式は一般的に移植性があることに注意してください。 =item semctl =item semget =item semop =begin original Not implemented. (Android, Win32, VMS, S) =end original 実装されていません。 (Android, Win32, VMS, S) =item setgrent =begin original Not implemented. (Android, VMS, Win32, S) =end original 実装されていません。 (Android, VMS, Win32, S) =item setpgrp =begin original Not implemented. (Win32, VMS, S, VOS) =end original 実装されていません。 (Win32, VMS, S, VOS) =item setpriority =begin original Not implemented. (Win32, VMS, S, VOS) =end original 実装されていません。 (Win32, VMS, S, VOS) =item setpwent =begin original Not implemented. (Android, Win32, S) =end original 実装されていません。 (Android, Win32, S) =item setsockopt =begin original Not implemented. (S) =end original 実装されていません。 (S) =item shmctl =item shmget =item shmread =item shmwrite =begin original Not implemented. (Android, Win32, VMS, S) =end original 実装されていません。 (Android, Win32, VMS, S) =item sleep =begin original Emulated using synchronization functions such that it can be interrupted by C, and limited to a maximum of 4294967 seconds, approximately 49 days. (Win32) =end original C で割り込みできるように同期関数を使ってエミュレートされていて、 最大 4294967 秒、およそ 49 日に制限されています。 (Win32) =item sockatmark =begin original A relatively recent addition to socket functions, may not be implemented even in Unix platforms. =end original 比較的最近に追加されたソケット関数で、Unix プラットフォームであっても 実装されていないかもしれません。 =item socketpair =begin original Not implemented. (S) =end original 実装されていません。 (S) =begin original Available on 64 bit OpenVMS 8.2 and later. (VMS) =end original 64 ビット OpenVMS 8.2 以降で利用可能です。 (VMS) =item stat =begin original Platforms that do not have rdev, blksize, or blocks will return these as '', so numeric comparison or manipulation of these fields may cause 'not numeric' warnings. =end original rdev, blksize, blocks がないプラットフォームではこれらは '' を返すので、 これらのフィールドの数値での比較や操作は 'not numeric' 警告を 引き起こします。 =begin original ctime not supported on UFS (S). =end original ctime は UFS では対応していません。 (S) =begin original ctime is creation time instead of inode change time (Win32). =end original ctime は i ノード変更時刻ではなく作成時刻です。 (Win32) =begin original device and inode are not meaningful. (Win32) =end original デバイスと i ノードは無意味です。 (Win32) =begin original device and inode are not necessarily reliable. (VMS) =end original デバイスと i ノードは信頼できる必要がありません。 (VMS) =begin original mtime, atime and ctime all return the last modification time. Device and inode are not necessarily reliable. (S) =end original mtime, atime, ctime は全て最終更新時刻を返します。 デバイスと i ノードは信頼する必要はありません。 (S) =begin original dev, rdev, blksize, and blocks are not available. inode is not meaningful and will differ between stat calls on the same file. (os2) =end original dev, rdev, blksize, blocks は利用できません。 inode は無意味で、同じファイルで stat 呼び出しの間でも異なります。 (os2) =begin original some versions of cygwin when doing a C and if not finding it may then attempt to C (Cygwin) =end original cygwin の一部のバージョンでは、C を実行して、もし 見付からなければ C を実行しようとします。 (Cygwin) =begin original On Win32 C needs to open the file to determine the link count and update attributes that may have been changed through hard links. Setting C<${^WIN32_SLOPPY_STAT}> to a true value speeds up C by not performing this operation. (Win32) =end original Win32 では C は、リンクカウントと、ハードリンクを通して 変更されるかもしれない属性の更新にはファイルを開く必要があります。 C<${^WIN32_SLOPPY_STAT}> を真の値に設定することで、この操作をしないことで C を高速化します。 (Win32) =item symlink =begin original Not implemented. (Win32, S) =end original 実装されていません。 (Win32, S) =begin original Implemented on 64 bit VMS 8.3. VMS requires the symbolic link to be in Unix syntax if it is intended to resolve to a valid path. =end original 64 ビット VMS 8.3 で実装されています。 VMS は、有効なパスを解決することを目的としているなら、シンボリックリンクが Unix の文法であることが必要です。 =item syscall =begin original Not implemented. (Win32, VMS, S, VOS) =end original 実装されていません。 (Win32, VMS, S, VOS) =item sysopen =begin original The traditional "0", "1", and "2" MODEs are implemented with different numeric values on some systems. The flags exported by C (O_RDONLY, O_WRONLY, O_RDWR) should work everywhere though. (S, OS/390) =end original 伝統的な "0", "1", "2" の MODE は一部のシステムでは異なる数値で 実装されています。 しかし、C でエクスポートされるフラグ (O_RDONLY, O_WRONLY, O_RDWR) は どこでも動作するはずです。 (S, OS/390) =item system =begin original As an optimization, may not call the command shell specified in C<$ENV{PERL5SHELL}>. C spawns an external process and immediately returns its process designator, without waiting for it to terminate. Return value may be used subsequently in C or C. Failure to C a subprocess is indicated by setting C<$?> to S>. C<$?> is set in a way compatible with Unix (i.e. the exitstatus of the subprocess is obtained by S> 8">>, as described in the documentation). (Win32) =end original 最適化として、C<$ENV{PERL5SHELL}> で指定されたコマンドシェルを 呼び出さないかもしれません。 C は外部プロセスを起動して、その終了を待たず、 直ちにそのプロセス指定子を返します。 返り値は引き続く C や C で使えます。 サブプロセスの C の失敗は、C<$?> に S> を設定することで 示されます。 C<$?> は Unix と互換性のある方法 (つまり、サブプロセスの終了ステータスは 文書に記述されている通りに S> 8">> で得られる) で設定されます。 (Win32) =begin original There is no shell to process metacharacters, and the native standard is to pass a command line terminated by "\n" "\r" or "\0" to the spawned program. Redirection such as C<< > foo >> is performed (if at all) by the run time library of the spawned program. C I will call the Unix emulation library's C emulation, which attempts to provide emulation of the stdin, stdout, stderr in force in the parent, providing the child program uses a compatible version of the emulation library. I will call the native command line direct and no such emulation of a child Unix program will exists. Mileage B vary. (S) =end original メタ文字を処理するシェルはなく、ネイティブな標準では "\n", "\r", "\0" で終端されたコマンドラインを spawn したプログラムに 渡します。 C<< > foo >> のようなリダイレクトは spawn したプログラムの ランタイムライブラリによって実行されます。 C I は Unix エミュレーションライブラリの C エミュレーションを呼び出し、子プログラムがエミュレーションライブラリの 互換版を使っているなら、親の stdin, stdout, stderr をエミュレーションを 提供しようとします。 I はネイティブなコマンドラインを直接呼び出し、子 Unix プログラムの エミュレーションは存在しません。 これは状況によって B<異なります>。 (S) =begin original C without the use of indirect object syntax (C) may fall back to trying the shell if the first C fails. (Win32) =end original 間接オブジェクト構文 (C) を使わない C は、 最初の C が失敗したときにシェルにフォールバックすることがあります。 (Win32) =begin original Does not automatically flush output handles on some platforms. (SunOS, Solaris, HP-UX) =end original 一部のプラットフォームでは出力ハンドルを自動的にフラッシュしません。 (SunOS, Solaris, HP-UX) =begin original The return value is POSIX-like (shifted up by 8 bits), which only allows room for a made-up value derived from the severity bits of the native 32-bit condition code (unless overridden by C). If the native condition code is one that has a POSIX value encoded, the POSIX value will be decoded to extract the expected exit value. For more details see L. (VMS) =end original 返り値は POSIX 風 (8 ビットシフト) で、(C で 上書きされない限り)ネイティブな 32 ビット条件コードの重大度ビットから 作り上げられた値のための場所だけがあります。 ネイティブな条件コードが POSIX 値をエンコードしたものなら、 POSIX 値は想定される終了コードを展開するためにデコードされます。 さらなる詳細については L を参照してください。 (VMS) =item telldir =begin original Not implemented. (Android) =end original 実装されていません。 (Android) =item times =begin original "cumulative" times will be bogus. On anything other than Windows NT or Windows 2000, "system" time will be bogus, and "user" time is actually the time returned by the C function in the C runtime library. (Win32) =end original 「累積」時間は偽りかもしれません。 Windows NT と Windows 2000 以外では、「システム」時間は偽りかもしれず、 「ユーザ」時間は実際には C ランタイムライブラリの C 関数から かえされた時刻です。 (Win32) =begin original Not useful. (S) =end original 使い道はありません。 (S) =item truncate =begin original Not implemented. (Older versions of VMS) =end original 実装されていません。 (Older versions of VMS) =begin original Truncation to same-or-shorter lengths only. (VOS) =end original 同じかより短い長さへの切り詰めのみです。 (VOS) =begin original If a FILEHANDLE is supplied, it must be writable and opened in append mode (i.e., use C<<< open(FH, '>>filename') >>> or C. If a filename is supplied, it should not be held open elsewhere. (Win32) =end original FILEHANDLE が指定されると、それは書き込み可能で、追記モード (つまり C<<< open(FH, '>>filename') >>> または C を使っている)でなければなりません。 ファイル名が指定されると、他で開いていてはいけません。 (Win32) =item umask =begin original Returns undef where unavailable. =end original 利用不可能な場合は undef を返します。 =begin original C works but the correct permissions are set only when the file is finally closed. (AmigaOS) =end original C は動作しますが、正しい権限はファイルが最終的に閉じられたときにのみ 設定されます。 (AmigaOS) =item utime =begin original Only the modification time is updated. (VMS, S) =end original 修正時刻が更新されたときのみです。 (VMS, S) =begin original May not behave as expected. Behavior depends on the C runtime library's implementation of C, and the filesystem being used. The FAT filesystem typically does not support an "access time" field, and it may limit timestamps to a granularity of two seconds. (Win32) =end original 想定した通りに動作しないかもしれません。 振る舞いは C ランタイムライブラリの C の実装と、使われる ファイルシステムに依存します。 FAT ファイルシステムは典型的には「アクセス時刻」フィールドに 対応しておらず、タイムスタンプの精度が 2 秒に制限されているかも しれません。 (Win32) =item wait =item waitpid =begin original Can only be applied to process handles returned for processes spawned using C or pseudo processes created with C. (Win32) =end original C を使って作成されたプロセスか、C で作成された 疑似プロセスで返されたプロセスハンドルに対してのみ適用できます。 (Win32) =begin original Not useful. (S) =end original 使い道はありません。 (S) =back =head1 Supported Platforms (対応しているプラットフォーム) =begin original The following platforms are known to build Perl 5.12 (as of April 2010, its release date) from the standard source code distribution available at L =end original 以下のプラットフォームは (リリース日である 2010 年 4 月時点で) L で利用可能な標準ソースコード配布から Perl 5.12 を ビルドしていることが知られています =over =item Linux (x86, ARM, IA64) =item HP-UX =item AIX =item Win32 =over =item Windows 2000 =item Windows XP =item Windows Server 2003 =item Windows Vista =item Windows Server 2008 =item Windows 7 =back =item Cygwin Some tests are known to fail: =over =item * =begin original F - see L =end original F - L を参照してください。 =item * F =item * =begin original F - may fail on recent cygwin installs. =end original F - 最近の cygwin では失敗します。 =back =item Solaris (x86, SPARC) =item OpenVMS =over =item Alpha (7.2 and later) =item I64 (8.2 and later) =back =item Symbian =item NetBSD =item FreeBSD =item Debian GNU/kFreeBSD =item Haiku =item Irix (6.5. What else?) =item OpenBSD =item Dragonfly BSD =item Midnight BSD =item QNX Neutrino RTOS (6.5.0) =item MirOS BSD =item Stratus OpenVOS (17.0 or later) =begin original Caveats: =end original 注意: =over =item time_t issues that may or may not be fixed (time_t の問題は修正されているかもしれませんしされていないかもしれません) =back =item Symbian (Series 60 v3, 3.2 and 5 - what else?) =item Stratus VOS / OpenVOS =item AIX =item Android =item FreeMINT =begin original Perl now builds with FreeMiNT/Atari. It fails a few tests, that needs some investigation. =end original Perl は FreeMiNT/Atari でビルド出来るようになりました。 いくつかのテストは失敗するので、調査が必要です。 =begin original The FreeMiNT port uses GNU dld for loadable module capabilities. So ensure you have that library installed when building perl. =end original FreeMiNT 版は読み込み可能モジュール機能のために GNU dld を使っています。 従って、perl をビルドするときにこのライブラリがあることを確認してください。 =back =head1 EOL Platforms (EOL プラットフォーム) =head2 (Perl 5.20) =begin original The following platforms were supported by a previous version of Perl but have been officially removed from Perl's source code as of 5.20: =end original 以下のプラットフォームは以前のバージョンの Perl では対応していましたが 5.20 の時点で Perl のソースコードから公式に取り除かれました: =over =item AT&T 3b1 =back =head2 (Perl 5.14) =begin original The following platforms were supported up to 5.10. They may still have worked in 5.12, but supporting code has been removed for 5.14: =end original 以下のプラットフォームは 5.10 まで対応していました。 5.12 でもまだ動作していましたが、対応コードは 5.14 で取り除かれました: =over =item Windows 95 =item Windows 98 =item Windows ME =item Windows NT4 =back =head2 (Perl 5.12) =begin original The following platforms were supported by a previous version of Perl but have been officially removed from Perl's source code as of 5.12: =end original 以下のプラットフォームは以前のバージョンの Perl では対応していましたが 5.12 の時点で Perl のソースコードから公式に取り除かれました: =over =item Atari MiNT =item Apollo Domain/OS =item Apple Mac OS 8/9 =item Tenon Machten =back =head1 Supported Platforms (Perl 5.8) (対応していたプラットフォーム (Perl 5.8)) =begin original As of July 2002 (the Perl release 5.8.0), the following platforms were able to build Perl from the standard source code distribution available at L =end original 2002 年 7 月 (Perl リリース 5.8.0) 現在、以下のプラットフォームが L から利用可能な標準ソースコード配布から ビルド可能でした: AIX BeOS BSD/OS (BSDi) Cygwin DG/UX DOS DJGPP 1) DYNIX/ptx EPOC R5 FreeBSD HI-UXMPP (Hitachi) (5.8.0 worked but we didn't know it) HP-UX IRIX Linux Mac OS Classic Mac OS X (Darwin) MPE/iX NetBSD NetWare NonStop-UX ReliantUNIX (formerly SINIX) OpenBSD OpenVMS (formerly VMS) Open UNIX (Unixware) (since Perl 5.8.1/5.9.0) OS/2 OS/400 (using the PASE) (since Perl 5.8.1/5.9.0) PowerUX POSIX-BC (formerly BS2000) QNX Solaris SunOS 4 SUPER-UX (NEC) Tru64 UNIX (formerly DEC OSF/1, Digital UNIX) UNICOS UNICOS/mk UTS VOS / OpenVOS Win95/98/ME/2K/XP 2) WinCE z/OS (formerly OS/390) VM/ESA 1) in DOS mode either the DOS or OS/2 ports can be used 2) compilers: Borland, MinGW (GCC), VC6 =begin original The following platforms worked with the previous releases (5.6 and 5.7), but we did not manage either to fix or to test these in time for the 5.8.0 release. There is a very good chance that many of these will work fine with the 5.8.0. =end original 以下のプラットフォームは以前のリリース (5.6 と 5.7) で動作していましたが、 5.8.0 リリースのときに修正やテストができませんでした。 これらの多くは 5.8.0 でうまく動く可能性がかなりあります。 BSD/OS DomainOS Hurd LynxOS MachTen PowerMAX SCO SV SVR4 Unixware Windows 3.1 =begin original Known to be broken for 5.8.0 (but 5.6.1 and 5.7.2 can be used): =end original 5.8.0 で壊れていることが知られています (しかし 5.6.1 と 5.7.2 は使えます): AmigaOS 3 =begin original The following platforms have been known to build Perl from source in the past (5.005_03 and earlier), but we haven't been able to verify their status for the current release, either because the hardware/software platforms are rare or because we don't have an active champion on these platforms--or both. They used to work, though, so go ahead and try compiling them, and let perlbug@perl.org of any trouble. =end original 以下のプラットフォームは過去 (5.005_03 以前) にソースから Perl を ビルドしたことが知られていますが、現在のリリースに対する状況を 確認できません; ハードウェア/ソフトウェアプラットフォームがレアなものか、 これらのプラットフォームに対するアクティブな推進者がいないか、 あるいはその両方が理由です。 しかし以前は動いていたので、ぜひコンパイルしてみて、 perlbug@perl.org に 問題点を知らせてください。 3b1 A/UX ConvexOS CX/UX DC/OSx DDE SMES DOS EMX Dynix EP/IX ESIX FPS GENIX Greenhills ISC MachTen 68k MPC NEWS-OS NextSTEP OpenSTEP Opus Plan 9 RISC/os SCO ODT/OSR Stellar SVR2 TI1500 TitanOS Ultrix Unisys Dynix =begin original The following platforms have their own source code distributions and binaries available via L =end original 以下のプラットフォームは L 経由で独自の ソースコード配布とバイナリが利用可能です: Perl release OS/400 (ILE) 5.005_02 Tandem Guardian 5.004 =begin original The following platforms have only binaries available via L : =end original 以下のプラットフォームは L 経由で バイナリのみが利用可能です: Perl release Acorn RISCOS 5.005_02 AOS 5.002 LynxOS 5.004_02 =begin original Although we do suggest that you always build your own Perl from the source code, both for maximal configurability and for security, in case you are in a hurry you can check L for binary distributions. =end original しかし、私たちは、最大限の設定可能性とセキュリティの両方のために、 常にあなた自身の Perl をソースからビルドすることを提案しています; 急いでいる場合には L にある バイナリ配布をチェックしてください。 =head1 SEE ALSO =begin original L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, and L. =end original L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L =head1 AUTHORS / CONTRIBUTORS Abigail , Charles Bailey , Graham Barr , Tom Christiansen , Nicholas Clark , Thomas Dorner , Andy Dougherty , Dominic Dunlop , Neale Ferguson , David J. Fiander , Paul Green , M.J.T. Guy , Jarkko Hietaniemi , Luther Huffman , Nick Ing-Simmons , Andreas J. KEnig , Markus Laker , Andrew M. Langmead , Larry Moore , Paul Moore , Chris Nandor , Matthias Neeracher , Philip Newton , Gary Ng <71564.1743@CompuServe.COM>, Tom Phoenix , AndrE Pirard , Peter Prymmer , Hugo van der Sanden , Gurusamy Sarathy , Paul J. Schinder , Michael G Schwern , Dan Sugalski , Nathan Torkington , John Malmberg =begin meta Translate: SHIRAKATA Kentaro (5.10.1-) Status: completed =end meta