[perldocjp-cvs 1447] CVS update: docs/perl/5.10.1

Back to archive index

argra****@users***** argra****@users*****
2012年 5月 27日 (日) 02:43:06 JST


Index: docs/perl/5.10.1/perldbmfilter.pod
diff -u docs/perl/5.10.1/perldbmfilter.pod:1.2 docs/perl/5.10.1/perldbmfilter.pod:1.3
--- docs/perl/5.10.1/perldbmfilter.pod:1.2	Sat Mar 17 01:00:23 2012
+++ docs/perl/5.10.1/perldbmfilter.pod	Sun May 27 02:43:06 2012
@@ -160,9 +160,8 @@
 
 =end original
 
-DBM Filters are useful for a class of problems where you I<always>
-want to make the same transformation to all keys, all values or both.
-(TBT)
+全てのキー、全ての値、あるいはその両方に対して同じ変換を I<常に>
+行いたいような問題の種類には DBM フィルタが便利です。
 
 =begin original
 
@@ -175,13 +174,14 @@
 
 =end original
 
-For example, consider the following scenario. You have a DBM database
-that you need to share with a third-party C application. The C application
-assumes that I<all> keys and values are NULL terminated. Unfortunately
-when Perl writes to DBM databases it doesn't use NULL termination, so
-your Perl application will have to manage NULL termination itself. When
-you write to the database you will have to use something like this:
-(TBT)
+例えば、以下のようなシナリオを考えます。
+サードパーティ C アプリケーションと共有する必要がある DBM データベースが
+あります。
+C アプリケーションは I<全ての> キーと値が NULL 終端されていることを
+仮定しています。
+残念ながら Perl が DBM データベースに書き込むときには NULL 終端しないので、
+Perl アプリケーションは自分自身で NULL 終端を管理する必要があります。
+データベースに書き込むときに、以下のようなことをする必要があります:
 
     $hash{"$key\0"} = "$value\0";
 
@@ -192,9 +192,8 @@
 
 =end original
 
-Similarly the NULL needs to be taken into account when you are considering
-the length of existing keys/values.
-(TBT)
+同様に、すでにあるキーや値の長さを考慮するときには NULL を計算に入れる
+必要があります。
 
 =begin original
 
@@ -207,13 +206,12 @@
 
 =end original
 
-It would be much better if you could ignore the NULL terminations issue
-in the main application code and have a mechanism that automatically
-added the terminating NULL to all keys and values whenever you write to
-the database and have them removed when you read from the database. As I'm
-sure you have already guessed, this is a problem that DBM Filters can
-fix very easily.
-(TBT)
+メインアプリケーションのコードでは NULL 終端問題を無視して、
+データベースに書き込むときには自動的に終端の NULL を追加して、
+データベースから読み込むときには自動的に削除する機構があれば
+とても便利です。
+既に想像はしていると思いますが、これは DBM フィルタが簡単に修正できる
+問題です。
 
     use strict;
     use warnings;
@@ -247,9 +245,8 @@
 
 =end original
 
-The code above uses SDBM_File, but it will work with any of the DBM
-modules.
-(TBT)
+上述のコードでは SDBM_File を使っていますが、いずれの DBM モジュールでも
+動作します。
 
 =begin original
 
@@ -259,11 +256,9 @@
 
 =end original
 
-Hopefully the contents of each of the filters should be
-self-explanatory. Both "fetch" filters remove the terminating NULL,
-and both "store" filters add a terminating NULL.
-(TBT)
-
+出来れば、それぞれのフィルタの内容は自己説明的であるべきです。
+両方の "fetch" フィルタは終端の NULL を削除し、両方の "store" フィルタは
+終端する NULL を追加します。
 
 =head2 Another Example -- Key is a C int.
 
@@ -277,10 +272,10 @@
 
 =end original
 
-Here is another real-life example. By default, whenever Perl writes to
-a DBM database it always writes the key and value as strings. So when
-you use this:
-(TBT)
+もう一つの実際の生活の例です。
+デフォルトでは、Perl が DBM データベースに書き込むときはいつでも、
+キーと値を文字列として書き込みます。
+従って、以下のように使うと:
 
     $hash{12345} = "something";
 
@@ -293,11 +288,11 @@
 
 =end original
 
-the key 12345 will get stored in the DBM database as the 5 byte string
-"12345". If you actually want the key to be stored in the DBM database
-as a C int, you will have to use C<pack> when writing, and C<unpack>
-when reading.
-(TBT)
+キー 12345 は、5 バイトの文字列 "12345" として DBM データベースとして
+保管されます。
+実際に DBM データベースに C の int としてキーを保管したい場合は、
+書き込むときに C<pack> を使い、読み込むときに C<unpack> を使う
+必要があります。
 
 =begin original
 
@@ -305,8 +300,7 @@
 
 =end original
 
-Here is a DBM Filter that does it:
-(TBT)
+以下はこのために DBM を使います:
 
     use strict;
     use warnings;
@@ -333,9 +327,8 @@
 
 =end original
 
-The code above uses DB_File, but again it will work with any of the
-DBM modules.
-(TBT)
+上述のコードでは DB_File を使っていますが、いずれの DBM モジュールでも
+動作します。
 
 =begin original
 
@@ -345,10 +338,8 @@
 
 =end original
 
-This time only two filters have been used -- we only need to manipulate
-the contents of the key, so it wasn't necessary to install any value
-filters.
-(TBT)
+今回は二つのフィルタだけを使っています -- キーの内容だけを操作する
+必要があるので、値フィルタをインストールする必要はありませんでした。
 
 =head1 SEE ALSO
 
@@ -367,6 +358,7 @@
 =begin meta
 
 Translate: SHIRAKATA Kentaro <argra****@ub32*****>
+Status: completed
 
 =end meta
 



perldocjp-cvs メーリングリストの案内
Back to archive index