=encoding euc-jp =head1 NAME =begin original URI - Uniform Resource Identifiers (absolute and relative) =end original URI - (絶対や相対の)統一資源識別子(Uniform Resource Identifiers) =head1 SYNOPSIS $u1 = URI->new("http://www.perl.com"); $u2 = URI->new("foo", "http"); $u3 = $u2->abs($u1); $u4 = $u3->clone; $u5 = URI->new("HTTP://WWW.perl.com:80")->canonical; $str = $u->as_string; $str = "$u"; $scheme = $u->scheme; $opaque = $u->opaque; $path = $u->path; $frag = $u->fragment; $u->scheme("ftp"); $u->host("ftp.perl.com"); $u->path("cpan/"); =head1 DESCRIPTION =begin original This module implements the C class. Objects of this class represent "Uniform Resource Identifier references" as specified in RFC 2396 (and updated by RFC 2732). =end original このモジュールは C クラスを実装します。 このクラスのオブジェクトは RFC 2396 で 指定されている (そして RFC 2732 更新された) 統一資源識別子参照 ("Uniform Resource Identifier references")を 表わしています。 =begin original A Uniform Resource Identifier is a compact string of characters that identifies an abstract or physical resource. A Uniform Resource Identifier can be further classified as either a Uniform Resource Locator (URL) or a Uniform Resource Name (URN). The distinction between URL and URN does not matter to the C class interface. A "URI-reference" is a URI that may have additional information attached in the form of a fragment identifier. =end original 統一資源識別子 (Uniform Resource Identifier) は抽象的あるいは物理的 リソースを識別するための文字のコンパクトな文字列です。 統一資源識別子はさらに統一資源位置指定子 (Uniform Resource Locator) (URL) と 統一資源名 (Uniform Resource Name) (URN) に分類することができます。 URL と URN の違いは C クラスインターフェースには関係ありません。 URI 参照 ("URI-reference") は、 フラグメントXS識別子 (fragment identifier) の形式で付けられる追加の情報を 持つことがある URI です。 =begin original An absolute URI reference consists of three parts: a I, a I and a I identifier. A subset of URI references share a common syntax for hierarchical namespaces. For these, the scheme-specific part is further broken down into I, I and I components. These URIs can also take the form of relative URI references, where the scheme (and usually also the authority) component is missing, but implied by the context of the URI reference. The three forms of URI reference syntax are summarized as follows: =end original 絶対 URI リファレンスは三つの部分で構成されます: I<スキーム>(scheme)、 I<スキーム独自部分> (scheme specific part)、 そして I<フラグメント> 識別子です。 URI リファレンスのサブセットは階層的名前空間のための共通の文法を共有します。 これらのためスキーム独自部分は、さらに I, I, I 要素に分けられます。 これらの URI は相対 URI リファレンスの形式を取ることもできます。 そこでは scheme (そして通常は authority も)要素がなく、しかし URI リファレンスの文脈により暗黙のうちに決められています。 URI リファレンスの書式の三つの形式は、以下のようにまとめることができます: :# ://?# ?# =begin original The components into which a URI reference can be divided depend on the I. The C class provides methods to get and set the individual components. The methods available for a specific C object depend on the scheme. =end original URI リファレンスの構成要素はスキームに依存して分割されます。 C クラスは個々の構成要素を取得し、設定するメソッドを提供します。 特定の C オブジェクトのために利用できるメソッドはスキームに依存します。 =head1 CONSTRUCTORS (コンストラクタ) =begin original The following methods construct new C objects: =end original 以下のメソッドが新しい C オブジェクトを組み立てます: =over 4 =item $uri = URI->new( $str ) =item $uri = URI->new( $str, $scheme ) =begin original Constructs a new URI object. The string representation of a URI is given as argument, together with an optional scheme specification. Common URI wrappers like "" and <>, as well as leading and trailing white space, are automatically removed from the $str argument before it is processed further. =end original 新しい URI オブジェクトを組み立てます。 URI の文字列表現が引数として、オプションのスキーム指定とともに与えられます。 "" や <> のような共通の URI ラッパ、そして前や後ろにつく空白は、さらに 処理される前に自動的に $str 引数から削除されます。 =begin original The constructor determines the scheme, maps this to an appropriate URI subclass, constructs a new object of that class and returns it. =end original コンストラクタはスキームを判定し、これを適切な URI サブクラスにマップし、 そのクラスの新しいオブジェクトを組み立て、それを返します。 =begin original The $scheme argument is only used when $str is a relative URI. It can be either a simple string that denotes the scheme, a string containing an absolute URI reference, or an absolute C object. If no $scheme is specified for a relative URI $str, then $str is simply treated as a generic URI (no scheme-specific methods available). =end original $scheme 引数は $str が相対 URI のときだけ使われます。 それにはスキームを示す単純な文字列、絶対 URI リファレンスが入った文字列、 絶対 C オブジェクトが指定できます。 相対 URI に $scheme が指定されなければ、$str は単純に(何もスキーム独自の メソッドが使えない)汎用の URI として扱われます。 =begin original The set of characters available for building URI references is restricted (see L). Characters outside this set are automatically escaped by the URI constructor. =end original URI リファレンスを組み立てるために使える文字のセットは 制限されています(L を参照してください)。 このセットから外れる文字は URI コンストラクタにより自動的に エスケープされます。 =item $uri = URI->new_abs( $str, $base_uri ) =begin original Constructs a new absolute URI object. The $str argument can denote a relative or absolute URI. If relative, then it is absolutized using $base_uri as base. The $base_uri must be an absolute URI. =end original 新しい絶対 URI オブジェクトを組み立てます。 $str 引数は相対もしくは絶対 URI を示すことができます。 そしてそれは $base_uri をベースとして使うことによって、絶対化されます。 $base_uri は絶対 URI でなければなりません。 =item $uri = URI::file->new( $filename ) =item $uri = URI::file->new( $filename, $os ) =begin original Constructs a new I URI from a file name. See L. =end original ファイル名から新しい I URI を組み立てます。 L を参照してください。 =item $uri = URI::file->new_abs( $filename ) =item $uri = URI::file->new_abs( $filename, $os ) =begin original Constructs a new absolute I URI from a file name. See L. =end original ファイル名から新しい絶対 I URI を組み立てます。 L を参照してください。 =item $uri = URI::file->cwd =begin original Returns the current working directory as a I URI. See L. =end original 現在作業中のディレクトリを I URI として返します。 L を参照してください。 =item $uri->clone =begin original Returns a copy of the $uri. =end original このメソッドは $uri のコピーを返します。 =back =head1 COMMON METHODS (共通メソッド) =begin original The methods described in this section are available for all C objects. =end original このセクションで説明されるメソッドはすべての C オブジェクトで 利用可能です。 =begin original Methods that give access to components of a URI always return the old value of the component. The value returned is C if the component was not present. There is generally a difference between a component that is empty (represented as C<"">) and a component that is missing (represented as C). If an accessor method is given an argument, it updates the corresponding component in addition to returning the old value of the component. Passing an undefined argument removes the component (if possible). The description of each accessor method indicates whether the component is passed as an escaped or an unescaped string. A component that can be further divided into sub-parts are usually passed escaped, as unescaping might change its semantics. =end original L の構成要素へのアクセスを提供するメソッドは常にその構成要素の 古い値を返します。 その構成要素がなければ返される値は C になります。 一般的に構成要素が空であること(C<""> で表されます)と構成要素がないこと (C で表されます)には違いがあります。 もしアクセサメソッドに引数が与えられれば、それは対応する構成要素を更新し、 その構成要素の古い値を返します。 未定義の引数を渡すと、(もし可能であれば)その構成要素を削除します。 それぞれのアクセサメソッドの説明がそのコンポーネントにエスケープされた 文字列として渡すのかあるいは、エスケープされない文字列として渡すのかを 示します。 さらに細かい部分に分割できる構成要素は、通常エスケープされて渡されます。 これはエスケープされていないとその意味が変わってしまうからです。 =begin original The common methods available for all URI are: =end original すべての URI で利用可能な共通メソッドを以下に示します: =over 4 =item $uri->scheme =item $uri->scheme( $new_scheme ) =begin original Sets and returns the scheme part of the $uri. If the $uri is relative, then $uri->scheme returns C. If called with an argument, it updates the scheme of $uri, possibly changing the class of $uri, and returns the old scheme value. The method croaks if the new scheme name is illegal; a scheme name must begin with a letter and must consist of only US-ASCII letters, numbers, and a few special marks: ".", "+", "-". This restriction effectively means that the scheme must be passed unescaped. Passing an undefined argument to the scheme method makes the URI relative (if possible). =end original $uri のスキーム部分を設定し、返します。 もし $uri が相対であれば、$uri->scheme は C を返します。 もし引数付きで呼ばれれば、$uri のスキームを更新し、おそらく $uri の クラスを変更します。 そして古いスキームの値を返します。 新しいスキーム名が不正であれば croak します: スキーム名は文字で始まり、 US-ASCII、数字そしていくつかの特別な記号: "."、"+"、"-" だけで 構成されなければなりません。 この制限は実質的にスキームはエスケープなしに渡されるべきであることを 意味しています。 スキームに未定義の引数を渡すと(可能であれば) URI は相対になります。 =begin original Letter case does not matter for scheme names. The string returned by $uri->scheme is always lowercase. If you want the scheme just as it was written in the URI in its original case, you can use the $uri->_scheme method instead. =end original 文字の大文字/小文字はスキーム名では問題ありません。 $uri->scheme で返される値は常に小文字です。 もし URI に書いた元の大文字/小文字の状態が欲しいのであれば、代わりに $uri->_scheme メソッドを使うことができます。 =item $uri->opaque =item $uri->opaque( $new_opaque ) =begin original Sets and returns the scheme-specific part of the $uri (everything between the scheme and the fragment) as an escaped string. =end original $uri のスキーム独自部分(スキームからフラグメントまでのすべて)を、 エスケープされた文字列として、設定し、返します。 =item $uri->path =item $uri->path( $new_path ) =begin original Sets and returns the same value as $uri->opaque unless the URI supports the generic syntax for hierarchical namespaces. In that case the generic method is overridden to set and return the part of the URI between the I and the I. =end original URI が階層的な名前空間のための一般的な書式をサポートしていなければ、 このメソッドは $uri->opaque と同じ値を設定し、返します。 その場合、I<ホスト名> と I<フラグメント> の間にある URI の一部を設定し、 返すように汎用メソッドがオーバーライドされます。 =item $uri->fragment =item $uri->fragment( $new_frag ) =begin original Returns the fragment identifier of a URI reference as an escaped string. =end original URI リファレンスのフラグメント識別子をエスケープされた文字列として 返します。 =item $uri->as_string =begin original Returns a URI object to a plain string. URI objects are also converted to plain strings automatically by overloading. This means that $uri objects can be used as plain strings in most Perl constructs. =end original URI オブジェクトをプレインな文字列にして返します。 URI オブジェクトはオーバーロードによっても自動的にプレーンな文字列に 変換されます。 つまり $uri オブジェクトはほとんどの Perl 構造においてプレーンな 文字列として扱うことができるということです。 =item $uri->canonical =begin original Returns a normalized version of the URI. The rules for normalization are scheme-dependent. They usually involve lowercasing the scheme and Internet host name components, removing the explicit port specification if it matches the default port, uppercasing all escape sequences, and unescaping octets that can be better represented as plain characters. =end original URI の正規化されたものを返します。 正規化のルールはスキームによって違います。 通常はスキームとインターネットホスト名要素の小文字化、 デフォルトポートと同じになっている明確なポート指定の削除、すべての エスケープシーケンスの大文字化、普通に表現することができる エスケープされていオクテットの通常化です。 =begin original For efficiency reasons, if the $uri is already in normalized form, then a reference to it is returned instead of a copy. =end original 効率の理由から、$uri がすでに正規化されている形式であれば、コピーの代わりに それへのリファレンスが返されます。 =item $uri->eq( $other_uri ) =item URI::eq( $first_uri, $other_uri ) =begin original Tests whether two URI references are equal. URI references that normalize to the same string are considered equal. The method can also be used as a plain function which can also test two string arguments. =end original 二つの URI リファレンスが同一であるかを調べます。 同じ文字列に正規化された URI リファレンスは同一であると考えます。 メソッドは二つの文字列引数テストすることもできる単なる関数として使うことも 出来ます。 =begin original If you need to test whether two C object references denote the same object, use the '==' operator. =end original 二つの C オブジェクトリファレンスが同じオブジェクトを示しているかを テストする必要があれば、'==' 演算子を使ってください。 =item $uri->abs( $base_uri ) =begin original Returns an absolute URI reference. If $uri is already absolute, then a reference to it is simply returned. If the $uri is relative, then a new absolute URI is constructed by combining the $uri and the $base_uri, and returned. =end original 絶対 URI リファレンスを返します。 もし $uri がすでに絶対であれば、それへのリファレンスが単に返されます。 $uri が相対であれば、$uri と $base_uri をつなげることにより新しい 絶対 URI が組み立てられ、返されます。 =item $uri->rel( $base_uri ) =begin original Returns a relative URI reference if it is possible to make one that denotes the same resource relative to $base_uri. If not, then $uri is simply returned. =end original 同じリソースを表す $base_uri への相対を作ることが出来れば、 相対 URI リファレンスを返します。 そうでなければ、$uri が単に返されます。 =back =head1 GENERIC METHODS (汎用メソッド) =begin original The following methods are available to schemes that use the common/generic syntax for hierarchical namespaces. The descriptions of schemes below indicate which these are. Unknown schemes are assumed to support the generic syntax, and therefore the following methods: =end original 以下のメソッドは、階層的名前空間のための共通/汎用の書式を使う スキームに使うことが出来ます。 下記のスキームの説明はこれらであることを示します。 分からないスキームは汎用の書式をサポートしており、そのため 以下のメソッドをサポートしているものと考えられます。 =over 4 =item $uri->authority =item $uri->authority( $new_authority ) =begin original Sets and returns the escaped authority component of the $uri. =end original $uri のエスケープされた authority(認証)構成要素を設定し、返します。 =item $uri->path =item $uri->path( $new_path ) =begin original Sets and returns the escaped path component of the $uri (the part between the host name and the query or fragment). The path can never be undefined, but it can be the empty string. =end original $uri のエスケープされた path 構成要素(ホスト名とクエリ(=query)または フラグメントの間の部分)を設定し、返します。 path は決して未定義になりませんが、空文字列にすることは出来ます。 =item $uri->path_query =item $uri->path_query( $new_path_query ) =begin original Sets and returns the escaped path and query components as a single entity. The path and the query are separated by a "?" character, but the query can itself contain "?". =end original エスケープされた path と query 構成要素を1つのエンティティとして設定し、 取得します。 path と query は "?" 文字により分けられますが、query それ自身に "?" を入れることが出来ます。 =item $uri->path_segments =item $uri->path_segments( $segment, ... ) =begin original Sets and returns the path. In a scalar context, it returns the same value as $uri->path. In a list context, it returns the unescaped path segments that make up the path. Path segments that have parameters are returned as an anonymous array. The first element is the unescaped path segment proper; subsequent elements are escaped parameter strings. Such an anonymous array uses overloading so it can be treated as a string too, but this string does not include the parameters. =end original path を設定し、返します。 スカラコンテキストでは $uri->path と同じ値を返します。 リストコンテキストでは path を構成するエスケープされない path セグメントを 返します。 パラメータを持っている path セグメントは無名配列として返されます。 最初の要素はエスケープされない path セグメントプロパーです; 続く要素はエスケープされえたパラメータ文字列です。 そのような無名配列は文字列としても扱うことが出来るようオーバーロードを 使いますが、この文字列にはパラメータは含まれません。 =begin original Note that absolute paths have the empty string as their first I, i.e. the I C have 3 I; "", "foo" and "bar". =end original 絶対パスは最初の I として空文字列を持つことに注意してください; つまり、I C は三つの I つまり "", "foo", "bar" になることに注意してください。 =item $uri->query =item $uri->query( $new_query ) =begin original Sets and returns the escaped query component of the $uri. =end original $uri のエスケープさえれた query 構成要素を設定し、返します。 =item $uri->query_form =item $uri->query_form( $key1 => $val1, $key2 => $val2, ... ) =item $uri->query_form( \@key_value_pairs ) =item $uri->query_form( \%hash ) =begin original Sets and returns query components that use the I format. Key/value pairs are separated by "&", and the key is separated from the value by a "=" character. =end original I 形式を使った query 構成要素を設定し、 返します。 キー/値の組は "&" で分けられ、そのキーは値から "=" 文字で分けられます。 =begin original The form can be set either by passing separate key/value pairs, or via an array or hash reference. Passing an empty array or an empty hash removes the query component, whereas passing no arguments at all leaves the component unchanged. The order of keys is undefined if a hash reference is passed. The old value is always returned as a list of separate key/value pairs. Assigning this list to a hash is unwise as the keys returned might repeat. =end original The form can be set either by passing separate key/value pairs, or via an array or hash reference. Passing an empty array or an empty hash removes the query component, whereas passing no arguments at all leaves the component unchanged. The order of keys is undefined if a hash reference is passed. The old value is always returned as a list of separate key/value pairs. Assigning this list to a hash is unwise as the keys returned might repeat. (TBT) =begin original The values passed when setting the form can be plain strings or references to arrays of strings. Passing an array of values has the same effect as passing the key repeatedly with one value at a time. All the following statements have the same effect: =end original The values passed when setting the form can be plain strings or references to arrays of strings. Passing an array of values has the same effect as passing the key repeatedly with one value at a time. All the following statements have the same effect: (TBT) $uri->query_form(foo => 1, foo => 2); $uri->query_form(foo => [1, 2]); $uri->query_form([ foo => 1, foo => 2 ]); $uri->query_form([ foo => [1, 2] ]); $uri->query_form({ foo => [1, 2] }); =begin original The C module can be loaded to add further methods to manipulate the form of a URI. See L for details. =end original URI の形式を操作するためのさらなるメソッドを追加するために、 C モジュールを読み込めます。 詳しくは L を参照してください。 =item $uri->query_keywords =item $uri->query_keywords( $keywords, ... ) =item $uri->query_keywords( \@keywords ) =begin original Sets and returns query components that use the keywords separated by "+" format. =end original "+" により分けられるキーワードのフォーマットを使っている query 構成要素を 設定し、返します。 =begin original The keywords can be set either by passing separate keywords directly or by passing a reference to an array of keywords. Passing an empty array removes the query component, whereas passing no arguments at all leaves the component unchanged. The old value is always returned as a list of separate words. =end original The keywords can be set either by passing separate keywords directly or by passing a reference to an array of keywords. Passing an empty array removes the query component, whereas passing no arguments at all leaves the component unchanged. The old value is always returned as a list of separate words. (TBT) =back =head1 SERVER METHODS (サーバメソッド) =begin original For schemes where the I component denotes an Internet host, the following methods are available in addition to the generic methods. =end original I 構成要素がインターネットホストを示すスキームは汎用メソッドに 加えて以下のメソッドを利用することが出来ます。 =over 4 =item $uri->userinfo =item $uri->userinfo( $new_userinfo ) =begin original Sets and returns the escaped userinfo part of the authority component. =end original エスケープされた authority 構成要素の userinfo 部分を設定し、返します。 =begin original For some schemes this is a user name and a password separated by a colon. This practice is not recommended. Embedding passwords in clear text (such as URI) has proven to be a security risk in almost every case where it has been used. =end original いくつかのスキームにとっては、コロンで区切られたこれはユーザ名と パスワードになります。 この実装は推奨されません。 (URI のように) 平文に埋め込むことは、使うすべての場合において セキュリティのリスクとなることが証明されています。 =item $uri->host =item $uri->host( $new_host ) =begin original Sets and returns the unescaped hostname. =end original エスケープされないホスト名を設定し、返します。 =begin original If the $new_host string ends with a colon and a number, then this number also sets the port. =end original $new_host 文字列がコロンと数字で終わっていれば、この番号はポートを 設定します。 =item $uri->port =item $uri->port( $new_port ) =begin original Sets and returns the port. The port is a simple integer that should be greater than 0. =end original ポートを設定し、返します。 ポートは 0 より大きくなければならない単純な整数です。 =begin original If a port is not specified explicitly in the URI, then the URI scheme's default port is returned. If you don't want the default port substituted, then you can use the $uri->_port method instead. =end original URI で明確にポートが指定されなければ、URI スキームのデフォルトのポートが 返されます。 デフォルトのポートへの置換をして欲しくないのであれば、$uri->_port メソッドを 代りに使うことが出来ます。 =item $uri->host_port =item $uri->host_port( $new_host_port ) =begin original Sets and returns the host and port as a single unit. The returned value includes a port, even if it matches the default port. The host part and the port part are separated by a colon: ":". =end original ホストとポートを一つの単位として設定し、返します。 デフォルトのポートにマッチしていても、返される値にはポートも含まれます。 ホスト部分とポート部分はコロン ":" で区切られます。 =item $uri->default_port =begin original Returns the default port of the URI scheme to which $uri belongs. For I this is the number 80, for I this is the number 21, etc. The default port for a scheme can not be changed. =end original $uri が所属する URI スキームのデフォルトポートを返します。 I では番号 80 になり、 I では番号 21 になります。 スキームのためのデフォルトポートは変更できません。 =back =head1 SCHEME-SPECIFIC SUPPORT (スキーム特有サポート) =begin original Scheme-specific support is provided for the following URI schemes. For C objects that do not belong to one of these, you can only use the common and generic methods. =end original 以下の URI スキームはスキーム固有のサポートが提供されています。 これらのうちの一つに所属していない C オブジェクトでは、共通と 汎用メソッドしか使えません。 =over 4 =item B: =begin original The I URI scheme is specified in RFC 2397. It allows inclusion of small data items as "immediate" data, as if it had been included externally. =end original I URI スキームは RFC2397 で定義されています。 これはまるで外部に含まれているかのように、小さなデータ要素を "immediate" データとして含むことを許しています。 =begin original C objects belonging to the data scheme support the common methods and two new methods to access their scheme-specific components: $uri->media_type and $uri->data. See L for details. =end original data スキームに所属する C オブジェクトは共通メソッドと、スキーム特有の 構成要素にアクセスするための2つの新しいメソッド; $uri->media_type と $uri->data をサポートします。 詳細は L を参照してください。 =item B: =begin original An old specification of the I URI scheme is found in RFC 1738. A new RFC 2396 based specification in not available yet, but file URI references are in common use. =end original B URI スキームの古い仕様は RFC 1738 にあります。 新しい RFC 2396 をベースとした仕様はまだ利用できませんが、file URI リファレンスは共通に使えます。 =begin original C objects belonging to the file scheme support the common and generic methods. In addition, they provide two methods for mapping file URIs back to local file names; $uri->file and $uri->dir. See L for details. =end original file スキームに所属する C オブジェクトは共通と汎用のメソッドを サポートします。 さらに file URI とローカルファイル名をマッピングする二つのメソッド; $uri->file, $uri->dir を提供します。 詳細は L を参照してください。 =item B: =begin original An old specification of the I URI scheme is found in RFC 1738. A new RFC 2396 based specification in not available yet, but ftp URI references are in common use. =end original I URI スキームの古い仕様は RFC 1738 にあります。 新しい RFC 2396 をベースとした仕様はまだ利用できませんが、ftp URI リファレンスは共通に使えます。 =begin original C objects belonging to the ftp scheme support the common, generic and server methods. In addition, they provide two methods for accessing the userinfo sub-components: $uri->user and $uri->password. =end original ftp スキームに所属する C オブジェクトは共通、汎用、サーバーの メソッドをサポートします。 さらに userinfo にアクセスするための二つのメソッド; $uri->user, $uri->password を提供します。 =item B: =begin original The I URI scheme is specified in and will hopefully be available as a RFC 2396 based specification. =end original I URI スキームは で定義され、 RFC 2396 ベース仕様として利用できる見込みです。 =begin original C objects belonging to the gopher scheme support the common, generic and server methods. In addition, they support some methods for accessing gopher-specific path components: $uri->gopher_type, $uri->selector, $uri->search, $uri->string. =end original gopher スキームに所属する C オブジェクトは共通、汎用、そして サーバメソッドをサポートします。 さらに gopher 特有の path 構成要素にアクセスするためのメソッドを サポートします: $uri->gopher_type, $uri->selector, $uri->search, $uri->string. =item B: =begin original The I URI scheme is specified in RFC 2616. The scheme is used to reference resources hosted by HTTP servers. =end original I URI スキームは RFC 2616 で定義されています。 このスキームは HTTP サーバによりホストされる参照リソースとして使われます。 =begin original C objects belonging to the http scheme support the common, generic and server methods. =end original http スキームに所属する C オブジェクトは共通、汎用そして サーバメソッドをサポートします。 =item B: =begin original The I URI scheme is a Netscape invention which is commonly implemented. The scheme is used to reference HTTP servers through SSL connections. Its syntax is the same as http, but the default port is different. =end original I URI スキームは Netscape が提案し、一般的に実装されています。 このスキームは SSL 接続を通した HTTP サーバ参照のために使われます。 その書式は http と同じですが、デフォルトポートは違います。 =item B: =begin original The I URI scheme is specified in RFC 2255. LDAP is the Lightweight Directory Access Protocol. An ldap URI describes an LDAP search operation to perform to retrieve information from an LDAP directory. =end original I URI スキームは RFC 2255 で定義されます。 LDAP は軽量ディレクトリアクセスプロトコル (Lightweight Directory Access Protocol)です。 ldap URI は LDAP ディレクトリから情報を取り出すために実行する LDAP 検索操作を 記述します。 =begin original C objects belonging to the ldap scheme support the common, generic and server methods as well as ldap-specific methods: $uri->dn, $uri->attributes, $uri->scope, $uri->filter, $uri->extensions. See L for details. =end original ldap スキームに所属する C オブジェクトは共通、汎用、サーバメソッドと ldap 固有のメソッドをサポートします: $uri->dn, $uri->attributes, $uri->scope, $uri->filter, $uri->extensions。 詳細は L を参照してください。 =item B: =begin original Like the I URI scheme, but uses a UNIX domain socket. The server methods are not supported, and the local socket path is available as $uri->un_path. The I scheme is used by the OpenLDAP package. There is no real specification for it, but it is mentioned in various OpenLDAP manual pages. =end original I URI スキームと同様ですが、UNIX ドメインソケットを使います。 サーバメソッドは非対応で、ローカルソケットパスは $uri->un_path で 利用可能です。 I スキームは OpenLDAP パッケージで使われています。 これに関する実際の仕様はありませんが、様々な OpenLDAP マニュアルページで 言及されています。 =item B: =begin original Like the I URI scheme, but uses an SSL connection. This scheme is deprecated, as the preferred way is to use the I mechanism. =end original I URI スキームと同様ですが、SSL 接続を使います。 このスキームは非推奨です; 好ましい方法は I 機構を使うことです。 =item B: =begin original The I URI scheme is specified in RFC 2368. The scheme was originally used to designate the Internet mailing address of an individual or service. It has (in RFC 2368) been extended to allow setting of other mail header fields and the message body. =end original I URI スキームは RFC 2368 で定義されています。 スキームは元はインターネットメーリングアドレスを示すために使われました。 それは(RFC 2368 で)他のメールヘッダフィールドとメッセージボディの設定を 許すように拡張されています。 =begin original C objects belonging to the mailto scheme support the common methods and the generic query methods. In addition, they support the following mailto-specific methods: $uri->to, $uri->headers. =end original mailto スキームに所属する C オブジェクトは共通メソッドと汎用の 問い合わせメソッドをサポートします。 さらに以下の mailto 独自のメソッドもサポートします: $uri->to, $uri->headers。 =item B: =begin original The I URL specification can be found at L C objects belonging to the mms scheme support the common, generic, and server methods, with the exception of userinfo and query-related sub-components. =end original The I URL specification can be found at L C objects belonging to the mms scheme support the common, generic, and server methods, with the exception of userinfo and query-related sub-components. (TBT) =item B: =begin original The I, I and I URI schemes are specified in and will hopefully be available as an RFC 2396 based specification soon. =end original I, I, I URI スキームは で 定義され、RFC 2396 ベース仕様として使えるようになる見込みです。 =begin original C objects belonging to the news scheme support the common, generic and server methods. In addition, they provide some methods to access the path: $uri->group and $uri->message. =end original news スキームに所属する C オブジェクトは共通、汎用そして サーバメソッドをサポートします。 さらに path にアクセスするためのいくつかのメソッドも提供します: $uri->group, $uri->message =item B: =begin original See I scheme. =end original I スキームを参照してください。 =item B: =begin original The I URI scheme is specified in RFC 2384. The scheme is used to reference a POP3 mailbox. =end original I URI スキームは RFC 2384 で定義されます。 スキームは POP3 メールボックスの参照に使われます。 =begin original C objects belonging to the pop scheme support the common, generic and server methods. In addition, they provide two methods to access the userinfo components: $uri->user and $uri->auth =end original pop スキームに所属する C オブジェクトは共通、汎用、そして サーバメソッドをサポートします。 さらに userinfo 構成要素にアクセスするための2つのメソッドを提供します: $uri->user, $uri->auth =item B: =begin original An old specification of the I URI scheme is found in RFC 1738. C objects belonging to the rlogin scheme support the common, generic and server methods. =end original I URI スキームの古い仕様は RFC 1738 にあります。 rlogin スキームに所属する C オブジェクトは共通、汎用、サーバメソッドを サポートします。 =item B: =begin original The I URL specification can be found in section 3.2 of RFC 2326. C objects belonging to the rtsp scheme support the common, generic, and server methods, with the exception of userinfo and query-related sub-components. =end original The I URL specification can be found in section 3.2 of RFC 2326. C objects belonging to the rtsp scheme support the common, generic, and server methods, with the exception of userinfo and query-related sub-components. (TBT) =item B: =begin original The I URI scheme is used to talk to RTSP servers over UDP instead of TCP. The syntax is the same as rtsp. =end original The I URI scheme is used to talk to RTSP servers over UDP instead of TCP. The syntax is the same as rtsp. (TBT) =item B: =begin original Information about rsync is available from http://rsync.samba.org. C objects belonging to the rsync scheme support the common, generic and server methods. In addition, they provide methods to access the userinfo sub-components: $uri->user and $uri->password. =end original Information about rsync is available from http://rsync.samba.org. C objects belonging to the rsync scheme support the common, generic and server methods. In addition, they provide methods to access the userinfo sub-components: $uri->user and $uri->password. (TBT) =item B: =begin original The I URI specification is described in sections 19.1 and 25 of RFC 3261. C objects belonging to the sip scheme support the common, generic, and server methods with the exception of path related sub-components. In addition, they provide two methods to get and set I parameters: $uri->params_form and $uri->params. =end original The I URI specification is described in sections 19.1 and 25 of RFC 3261. C objects belonging to the sip scheme support the common, generic, and server methods with the exception of path related sub-components. In addition, they provide two methods to get and set I parameters: $uri->params_form and $uri->params. (TBT) =item B: =begin original See I scheme. Its syntax is the same as sip, but the default port is different. =end original See I scheme. Its syntax is the same as sip, but the default port is different. (TBT) =item B: =begin original See I scheme. Its syntax is the same as news, but the default port is different. =end original I スキームを参照してください。 その書式は news と同じですが、デフォルトポートは違います。 =item B: =begin original An old specification of the I URI scheme is found in RFC 1738. C objects belonging to the telnet scheme support the common, generic and server methods. =end original I URI スキームの古い仕様は RFC 1738 にあります。 telnet スキームに所属する C オブジェクトは共通、汎用そして サーバメソッドをサポートします。 =item B: =begin original These URIs are used like I URIs but for connections to IBM mainframes. C objects belonging to the tn3270 scheme support the common, generic and server methods. =end original These URIs are used like I URIs but for connections to IBM mainframes. C objects belonging to the tn3270 scheme support the common, generic and server methods. (TBT) =item B: =begin original Information about ssh is available at http://www.openssh.com/. C objects belonging to the ssh scheme support the common, generic and server methods. In addition, they provide methods to access the userinfo sub-components: $uri->user and $uri->password. =end original Information about ssh is available at http://www.openssh.com/. C objects belonging to the ssh scheme support the common, generic and server methods. In addition, they provide methods to access the userinfo sub-components: $uri->user and $uri->password. (TBT) =item B: =begin original The syntax of Uniform Resource Names is specified in RFC 2141. C objects belonging to the urn scheme provide the common methods, and also the methods $uri->nid and $uri->nss, which return the Namespace Identifier and the Namespace-Specific String respectively. =end original The syntax of Uniform Resource Names is specified in RFC 2141. C objects belonging to the urn scheme provide the common methods, and also the methods $uri->nid and $uri->nss, which return the Namespace Identifier and the Namespace-Specific String respectively. (TBT) =begin original The Namespace Identifier basically works like the Scheme identifier of URIs, and further divides the URN namespace. Namespace Identifier assignments are maintained at . =end original The Namespace Identifier basically works like the Scheme identifier of URIs, and further divides the URN namespace. Namespace Identifier assignments are maintained at . (TBT) =begin original Letter case is not significant for the Namespace Identifier. It is always returned in lower case by the $uri->nid method. The $uri->_nid method can be used if you want it in its original case. =end original Letter case is not significant for the Namespace Identifier. It is always returned in lower case by the $uri->nid method. The $uri->_nid method can be used if you want it in its original case. (TBT) =item B:B: =begin original The C namespace contains International Standard Book Numbers (ISBNs) and is described in RFC 3187. A C object belonging to this namespace has the following extra methods (if the Business::ISBN module is available): $uri->isbn, $uri->isbn_publisher_code, $uri->isbn_country_code, $uri->isbn_as_ean. =end original The C namespace contains International Standard Book Numbers (ISBNs) and is described in RFC 3187. A C object belonging to this namespace has the following extra methods (if the Business::ISBN module is available): $uri->isbn, $uri->isbn_publisher_code, $uri->isbn_country_code, $uri->isbn_as_ean. (TBT) =item B:B: =begin original The C namespace contains Object Identifiers (OIDs) and is described in RFC 3061. An object identifier consists of sequences of digits separated by dots. A C object belonging to this namespace has an additional method called $uri->oid that can be used to get/set the oid value. In a list context, oid numbers are returned as separate elements. =end original The C namespace contains Object Identifiers (OIDs) and is described in RFC 3061. An object identifier consists of sequences of digits separated by dots. A C object belonging to this namespace has an additional method called $uri->oid that can be used to get/set the oid value. In a list context, oid numbers are returned as separate elements. (TBT) =back =head1 CONFIGURATION VARIABLES (構成設定変数) =begin original The following configuration variables influence how the class and its methods behave: =end original 以下の構成設定変数がクラストそのメソッドがどのように動くかに影響を与えます: =over 4 =item $URI::ABS_ALLOW_RELATIVE_SCHEME =begin original Some older parsers used to allow the scheme name to be present in the relative URL if it was the same as the base URL scheme. RFC 2396 says that this should be avoided, but you can enable this old behaviour by setting the $URI::ABS_ALLOW_RELATIVE_SCHEME variable to a TRUE value. The difference is demonstrated by the following examples: =end original いくつかの古いパーサは、ベース URL スキームと同じであれば、スキーム名が 相対でも存在することを許すことがあります。 RFC 2396 はこれはやめるべきだと言っていますが、 $URI::ABS_ALLOW_RELATIVE_SCHEME 変数を TRUE に設定することによりこの古い 動きを可能にできます。 以下の例で違いを示します: URI->new("http:foo")->abs("http://host/a/b") ==> "http:foo" local $URI::ABS_ALLOW_RELATIVE_SCHEME = 1; URI->new("http:foo")->abs("http://host/a/b") ==> "http:/host/a/foo" =item $URI::ABS_REMOTE_LEADING_DOTS =begin original You can also have the abs() method ignore excess ".." segments in the relative URI by setting $URI::ABS_REMOTE_LEADING_DOTS to a TRUE value. The difference is demonstrated by the following examples: =end original $URI::ABS_REMOTE_LEADING_DOTS を TRUE に設定することにより、abs() メソッドに 相対 URI での過剰な ".." セグメントを無視させることもできます。 以下の例で違いを示します: URI->new("../../../foo")->abs("http://host/a/b") ==> "http://host/../../foo" local $URI::ABS_REMOTE_LEADING_DOTS = 1; URI->new("../../../foo")->abs("http://host/a/b") ==> "http://host/foo" =back =head1 BUGS =begin original Using regexp variables like $1 directly as arguments to the URI methods does not work too well with current perl implementations. I would argue that this is actually a bug in perl. The workaround is to quote them. Example: =end original URI メソッドへの引数として、$1 のような正規表現変数を直接使うと、 現在の perl の実装ではあまりうまく動きません。 私はこれは perl のバグであると主張しています。 回避方法は、クォートすることです。 例: /(...)/ || die; $u->query("$1"); =head1 PARSING URIs WITH REGEXP (正規表現を含む URI のパース) =begin original As an alternative to this module, the following (official) regular expression can be used to decode a URI: =end original このモジュールの代替品として、以下の (公式) 正規表現が URI のデコードに 使えます: my($scheme, $authority, $path, $query, $fragment) = $uri =~ m|(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?|; =begin original The C module provides the function uri_split() as a readable alternative. =end original C モジュールは、可読な代替物として uri_split() 関数を 提供します。 =head1 SEE ALSO L, L, L, L, L, L RFC 2396: "Uniform Resource Identifiers (URI): Generic Syntax", Berners-Lee, Fielding, Masinter, August 1998. http://www.iana.org/assignments/uri-schemes http://www.iana.org/assignments/urn-namespaces http://www.w3.org/Addressing/ =head1 COPYRIGHT Copyright 1995-2003 Gisle Aas. Copyright 1995 Martijn Koster. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 AUTHORS / ACKNOWLEDGMENTS This module is based on the C module, which in turn was (distantly) based on the C code in the libwww-perl for perl4 developed by Roy Fielding, as part of the Arcadia project at the University of California, Irvine, with contributions from Brooks Cutter. C was developed by Gisle Aas, Tim Bunce, Roy Fielding and Martijn Koster with input from other people on the libwww-perl mailing list. C and related subclasses was developed by Gisle Aas. =begin meta Translate: Hippo2000 (1.04) Update: SHIRAKATA Kentaro (1.35) Status: in progress =end meta =cut