/
POE.pod
1303 lines (899 loc) · 44.3 KB
/
POE.pod
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
=encoding euc-jp
=head1 NAME
POE - multitasking and networking framework for perl
POE - マルチタスク及びネットワークのperl用フレームワーク
=head1 SYNOPSIS
#!/usr/bin/perl -w
use strict;
# POEを使う!
use POE;
sub handler_start {
my ($kernel, $heap, $session) = @_[KERNEL, HEAP, SESSION];
print "Session ", $session->ID, " has started.\n";
$heap->{count} = 0;
$kernel->yield('increment');
}
sub handler_increment {
my ($kernel, $heap, $session) = @_[KERNEL, HEAP, SESSION];
print "Session ", $session->ID, " counted to ", ++$heap->{count}, ".\n";
$kernel->yield('increment') if $heap->{count} < 10;
}
sub handler_stop {
print "Session ", $_[SESSION]->ID, " has stopped.\n";
}
for (0..9) {
POE::Session->create(
inline_states =>
{ _start => \&handler_start,
increment => \&handler_increment,
_stop => \&handler_stop,
}
);
}
$poe_kernel->run();
exit;
=head1 QUICK LINKS
Please see the SEE ALSO section for conceptual summary of all POE's
documentation.
POEの全ドキュメントの基本的な要約についてはSEE ALSOセクションを参照して
ください。
POE's distribution comes with a directory full of examples, but they
are gradually being phased out in favor of an online "cookbook".
Please see the samples directory, and also look at
http://poe.perl.org/?POE_Cookbook for more contemporary examples.
POEのディストリビューションにはサンプルスクリプトの詰まったディレクトリ
が付属していますが、それらはオンライン"クックブック"を優先して徐々に取
り除かれていっています。samplesディレクトリを見るか、または最新のサンプ
ルが http://poe.perl.org/?POE_Cookbook にあるので参照してください。
Please see http://www.perl.com/pub/2001/01/poe.html for an excellent,
and more importantly: gradual, introduction to POE. If this manpage
doesn't make sense, perhaps the introduction will.
優れた、より重要なことには段階的な、POEの手引きが
http://www.perl.com/pub/2001/01/poe.html にあるので参照してください。も
しこのmanページを読んでも理解できない場合は、おそらくこの手引きを読むと
理解できるでしょう。
Please see POE's web site at http://poe.perl.org/ for FAQs, cookbook
examples, and modules using POE.
FAQ、クックブック、サンプル、POEを使用しているモジュールについてはPOEの
Webサイト http://poe.perl.org/ を参照してください。
=head1 DESCRIPTION
POE is an acronym of "Perl Object Environment". It originally was
designed as the core of a persistent object server and runtime
environment, but it's evolved into a general purpose multitasking and
networking framework.
POEは"Perl Object Environment"(Perlオブジェクト環境)の頭文字を取った略
語です。元々は永続オブジェクトサーバや実行時環境(ランタイム環境)の中心
として設計されましたが、汎用のマルチタスキングとネットワーキングのフレ
ームワークに発展しました。
POE's core contains two types of modules. First there's POE::Kernel;
this is the main resource manager and event loop. Second are the
sessions or state machines which implement the actual threads. The
sessions are POE::Session (not quite a proper state machine) and
POE::NFA.
POEの中心は2種類のモジュールを含んでいます。一つはPOE::Kernel(カーネル)
です; これはリソース(資源)の中心的な管理者とイベントループです。もう一
つはセッションまたは状態機械で、実際のスレッドを実装します。セッション
はPOE::Session(完全に適切な状態機械ではありません)とPOE::NFAです。
The remainder of this distribution consists of convenience and helper
modules, most of which aren't required to begin using POE.
このディストリビューションの残りは便利で手助けとなるモジュールで構成さ
れており、その大部分はPOEを使い始めるのに必須ではありません。
=head1 USING POE
Using POE can be pretty tedious. Consider this example, which pulls
in the necessary modules for a line-based TCP server:
POEの使用はとても退屈になりえます。行ベースのTCPサーバに必要なモジュー
ルを引き出すこの例を考えてみてください。
use POE::Kernel;
use POE::Session;
use POE::Wheel::SocketFactory;
use POE::Wheel::ReadWrite;
use POE::Filter::Line;
use POE::Driver::SysRW;
The POE.pm module fixes some of this tedium. When POE.pm is used
directly, it automatically includes POE::Kernel and POE::Session. It
also includes each of the C<use> statement's parameters, first
prepending "POE::" to them. An example is in order:
POE.pmモジュールはこの退屈さをいくらか改善します。POE.pmが直接useされる
と、自動的にPOE::KernelとPOE::Sessionもインクルードされます。さらに
C<use>文の各引数に対して語頭に"POE::"が付加されたものもインクルードされ
ます。
This C<use> statement is equivalent to the previous six.
このC<use>文は先の6つの文と等価です。
use POE qw( Wheel::SocketFactory Wheel::ReadWrite
Filter::Line Driver::SysRW
);
=head1 WRITING POE PROGRAMS
Basic POE programs have four parts.
基本的なPOEプログラムには4つのパートがあります。
=over 2
=item Preliminary program setup
プログラムの準備設定
This is the usual overhead for writing a Perl program: a shebang line,
perhaps some C<use> statements to import things, and maybe some global
variables or configuration constants. It's all pretty standard stuff.
これはPerlプログラムを書くための通常のオーバーヘッドです。即ち、シェバ
ング(#!)行や、おそらく何かをインポートするためのC<use>文、グローバル変
数や環境設定(コンフィギュレーション)用定数もあるでしょう。これは全く標
準的なことです。
#!/usr/bin/perl -w
use strict;
use POE;
=item Define the program's event handlers or states
プログラムのイベントハンドラや状態を定義
Declare functions which will handle events here. This is deceptive,
since the functions can be declared anywhere, including as anonymous
subroutines in a session constructor call.
イベントを扱う関数をここで宣言してください。これは便宜的なものです。な
ぜなら関数はどんなところでも、例えばセッションのコンストラクタを呼び出
している途中に無名サブルーチンとしてでも、宣言することができるからです。
sub handler_start {
...
}
sub handler_increment {
...
}
sub handler_stop {
...
}
=item Start initial sessions or machines
最初のセッション機械の開始
The Kernel only runs as long as there is something for it to do. It's
main loop returns after the last session has stopped. The obvious
corolary to this rule is that the main loop will return immediately if
nothing is set up when it's called.
カーネルは何かすることがある限り動きます。そのメインループは最後のセッ
ションが停止した後に戻ります。この規則での明らかな結果は、もし呼ばれた
ときに何も設定されていなければ、メインループは直ちに戻るということです。
for (0..9) {
POE::Session->create(
inline_states =>
{ _start => \&handler_start,
increment => \&handler_increment,
_stop => \&handler_stop,
}
);
}
=item Start the kernel's main loop
カーネルのメインループの開始
_start handlers are invoked immediately when sessions are
instantiated. Everything else happens because the kernel makes it so,
and the kernel can't do that 'til it's started. Most programs exit
afterwards since the kernel only returns after everything is done.
セッションがインスタンス化されると直ちに_startハンドラが呼ばれます。そ
の他全てのことが起きるのはカーネルがそうするからで、またカーネルは開始
されっっるまでそれを行うことはできません。その後ほとんどのプログラムは
exitしますが、それはカーネルは全てが完了した後にのみ戻るからです。
$poe_kernel->run();
exit 0;
=back
=head1 POE's ARCHITECTURE
POE is built in separate layers. Each layer requires the ones beneath
it, but no low-level layer requires a higher one.
POEは複数のレイヤに分けられて構築されています。各レイヤはすぐ下のものを
必要としますが、低レベルのレイヤがより高いものを必要とすることはありま
せん。
=over 2
=item Events layer
イベントレイヤ
The events layer consists of an event dispatcher, POE::Kernel, and the
sessions or state machines it runs: POE::Session (a generic event
driven thread) and POE::NFA (an event driven nondeterministic finite
automaton).
イベントレイヤはイベントディスパッチャPOE::Kernelと、それが実行するセッ
ションまたは状態機械POE::Session(汎用のイベントドリブンのスレッド)と
POE::NFA(イベントドリブンの非決定性有限オートマトン)で構成されています。
=item One or more I/O layers
1つ以上のI/Oレイヤ
I/O layers are built upon the event layer, and that allows them to
coexist in the same program. POE only includes one I/O layer: Wheels.
"Wheels" is a whimsical name for interlocking cogs that together make
things go. They're also reinvented a lot, and this is no exception.
I/Oレイヤはイベントレイヤの上に構築されており、そのおかげで同じプログラ
ムの中でそれらが共存することができます。POEにはホイール(wheel)というた
だ1つだけのI/Oレイヤが収録されています。"ホイール"とは、歯車の歯と組合
わさって共に物事を動くようにするという意味の一風変わった名前です。また
それらは何度も再発明されますが、これも例外ではありません。
POE comes with six wheels.
POEには6つのホイールが付属しています。
=over 2
=item POE::Wheel::Curses
The Curses wheel handles non-blocking input for programs using the
curses text interface. It requires the Curses perl module and a
familiarity with curses programming.q
Cursesホイールはcursesテキストインターフェースをしようしているプログラ
ム用にノンブロッキングの入力を扱います。これが必要とするものはPerlモジ
ュールのCursesとcursesプログラミングに精通していることです。
=item POE::Wheel::FollowTail
FollowTail follows the tail of an ever-growing file. It's useful for
watching logs and things of that nature.
FollowTailは絶えず大きくなっていくファイルの最後尾を追います。これはロ
グやそのような性質を持つものを見張るのに役立ちます。
=item POE::Wheel::ListenAccept
ListenAccept performs ye olde non-blocking socket listen and accept.
It's great for programs that can't use SocketFactory and instead must
listen and accept connections from sockets created elsewhere.
ListenAcceptは古めかしいノンブロッキングのソケットのlistenとacceptを行
います。これは、SocketFactoryは使用できないが他の場所で生成されたソケッ
トからの接続をlistenしacceptしなければならないプログラムにとって役立ち
ます。
=item POE::Wheel::ReadLine
The ReadLine wheel accepts console input as lines only. It handles
many of the common shell command editing keystrokes, making it pretty
easy to input things. It's event driven, unlike Term::ReadLine, and
it cooperates nicely with the rest of POE.
ReadLineホイールは行単位のコンソールからの入力のみを受け付けます。これ
は基本的なシェルコマンドの編集キーの多くを扱い、入力することをとても簡
単にします。これはTerm::ReadLineと違ってイベントドリブンなので、POEの他
の部分とうまく協調します。
=item POE::Wheel::ReadWrite
ReadWrite is the star of POE's default I/O layer. It performs
buffered, flow-controlled I/O on non-blocking, unbuffered filehandles.
It almost acts like a Unix stream which can't stack protocol layers,
but that may change.
ReadWriteはPOEのデフォルトのI/Oレイヤの花形です。これはノンブロッキング
でバッファのないファイルハンドル上でバッファのあるフロー制御されたI/Oを
行います。ほとんどプロトコル層を積み重ねることができないUnixストリーム
のように振る舞いますが、これは変更されるかもしれません。
ReadWrite uses two other classes to do its dirty work: Driver and
Filter. Drivers do the actual work of reading and writing
filehandles. Filters translate between raw streams and cooked chunks
of tasty dada.
ReadWriteは泥臭い仕事を行うために他に2つのクラスDriver(ドライバ)と
Filter(フィルタ)を使用します。ドライバはファイルハンドルを読んだり書い
たりする実際の仕事を行います。フィルタは生のストリームと風味のある調理
されたチャンク(chunk)との間の変換を行います。
D comes before F, so Drivers go first.
Fより先にDが来るので、ドライバを先に紹介します。
=over 2
=item POE::Driver::SysRW
Nobody has needed another driver yet, so this is the only one
currently available. It performs sysread and syswrite in a generic
way so that ReadWrite can use it and future drivers interchangeably.
誰も他のフィルタを必要としていないので、現在利用できるのはこれ一つです。
これはsysreadとsyswriteを一般的な方法で行うので、ReadWriteはこれと将来
のドライバを交換して使用することができます。
Other drivers will use the same interface, should they ever be
written.
もし他のドライバが書かれるべきであれば、それらは同じインターフェースを
利用するでしょう。
=back
Filters next. There are a few.
次にフィルタを紹介します。これはいくつかあります。
=over 2
=item POE::Filter::Block
This filter parses input as fixed-length blocks. On the output side,
it merely passes data through unscathed.
このフィルタは入力を固定長のブロックとしてパースします。出力側では、単
にデータを無傷のまま渡します。
=item POE::Filter::HTTPD
The HTTPD filter parses input as HTTP requests and translates them
into HTTP::Request objects. On the output side, it takes
HTTP::Response objects and turns them into something suitable to be
sent to a web client/user-agent.
HTTPDフィルタは入力をHTTPリクエストとしてパースし、それらをHTTP::
Requestオブジェクトに変換します。出力側では、HTTP::Responseオブジェクト
を受け取ってそれらをwebクライアント/ユーザエージェントに送るのに適した
ものに変換します。
=item POE::Filter::Line
The Line filter parses incoming streams into lines and turns outgoing
lines into streams. It used to be very basic, but recent improvements
have added interesting features like newline autodetection.
Lineフィルタは入力ストリームを行単位にパースし、行単位の出力をストリー
ムに変換します。以前は非常に基礎的なものでしたが、最近の改良によって改
行の自動検出のような興味深い機能が追加されました。
=item POE::Filter::Reference
The Reference filter is used to send Perl structures between POE
programs or between POE and other Perl programs. On the input side,
frozen data (via Storable, FreezeThaw, YAML, or some other data
mechanism) is thawed into Perl data structures. On output, references
given to the filter are frozen. Data may also be compressed on
request if Compress::Zlib is installed.
ReferenceフィルタはPOEプログラム間またはPOEと他のPerlプログラム間でPerl
の構造体を渡すために使用されます。入力側では、(Storable、FreezeThaw、
YAML、あるいは他のデータメカニズムによって)冷凍(freeze)されたデータが
Perlの構造体に解凍(thaw)されます。出力側では、フィルタに渡されたリファ
レンスが冷凍されます。またCompress::Zlibがインストールされていれば、要
求次第でデータを圧縮することもできます。
=item POE::Filter::Stream
The stream filter does nothing. It merely passes data through without
any change.
Streamフィルタは何も行いません。単にデータを何の変更もなしに渡します。
=back
=item POE::Wheel::Run
The Run wheel provides a way to run functions or other programs in
child processes. It encapsulates the necessary pipe() and fork()
code, and sometimes exec(). Internally, it handles reading from and
writing to child processes without further intervention. Child output
arrives in the Wheel's owner as events.
Runホイールは関数や他のプログラムを子プロセスで動かす方法を提供します。
これは必要なpipe()、fork()、時にはexec()をカプセル化します。内部的には、
子プロセスへの読み込みと書き込みをそれ以上の干渉なしに扱います。子プロ
セスの出力はそのホイールの所有者にイベントとして届きます。
=item POE::Wheel::SocketFactory
SocketFactory creates all manner of connectionless and connected
network sockets. It also listens on TCP server sockets, only
returning accepted client connections as they arrive.
SocketFactoryはあらゆる種類のコネクション型およびコネクションレス型のネ
ットワークソケットを生成します。またTCPサーバソケットをlistenし、accept
されたクライアントのコネクションをそれらが到着したときにのみ返します。
=back
=back
=head1 POE COMPONENTS
Components consist of one or more sessions or state machines that
encapsulate a very high level procedure. For example,
POE::Component::IRC (not included) performs nearly all the functions
of a full-featured IRC client. POE::Component::UserBase (not
included) is a user authentication and data persistence servlet.
コンポーネント(component)は非常に高水準の手続きをカプセル化する1つ以上
のセッションまたは状態機械から構成されます。例えば、POE::Component::IRC
(未収録)は完全な機能を備えたIRCクライアントのほとんど全ての機能を果たし
ます。POE::Component::UserBase(未収録)はユーザ認証とデータ永続化のサー
ブレットです。
Components tend to be highly reusable libraries that handle tedious
tasks, freeing programmers to focus on more interesting things. This
should be true for any library, though.
コンポーネントは再利用性が高いライブラリである傾向があり、退屈な仕事を
扱ってプログラマがより興味のあることに集中できるようにします。このこと
はどんなライブラリについても正しいべきですが。
A list of released POE::Component modules is at:
http://search.cpan.org/search?mode=module&query=POE%3A%3AComponent
リリース済みのPOE::Componentモジュールの一覧は
http://search.cpan.org/search?mode=module&query=POE%3A%3AComponent にあ
ります。
=over 2
=item POE::Component::Client::TCP
The Client::TCP component provides the most common core features for
writing TCP clients.
Client::TCPコンポーネントはTCPクライアントを書くための最も基本的で核と
なる機能を提供します。
=item POE::Component::Server::TCP
The Server::TCP component provides the most common core features for
writing TCP servers. A simple echo server is about 20 lines.
Server::TCPコンポーネントはTCPサーバを書くための最も基本的で核となる機
能を提供します。単純なechoサーバはおよそ20行です。
=back
=head1 Support Modules
Finally, there are some files which POE uses but aren't required
elsewhere. These include POE::Preprocessor and the base classes:
POE::Component, POE::Driver, POE::Filter and POE::Wheel. There also
are some development files in the lib directory.
最後に、POEは使用するけれど他では必要とされないファイルがあります。それ
らにはPOE::Preprocessorと基底クラスPOE::Component、POE::Driver、POE::
Filter、POE::Wheelが含まれます。また、libディレクトリには開発ファイルも
あります。
=over 2
=item POE::Preprocessor
This is a macro preprocessor. It also implements plain and enumerated
constants. POE::Kernel uses it to inline smaller functions and make
the source generally more readable. There seem to be two drawbacks:
First, code is more difficult to examine in perl's debugger since it
doesn't necessarily look like the original source. Second, programs
take longer to start up because every source line must first pass
through a perl filter. The compile-time penalty is negligible in
long-running programs, and the runtime boost from fewer function calls
can make up for it over time.
これはマクロのプリプロセッサです。また通常の定数や列挙型の定数も実装し
ます。小さい関数をインラインに記述してソースを一般的により読みやすくす
るためにPOE::Kernelが使用します。欠点が2つあるようです。一つは、コード
が本来のソースのように見える必要がないのでperlのデバッガで検査するのが
より難しくなることです。もう一つは、ソースの全ての行が最初にperlのフィ
ルタを通過しなければならないので、プログラムの開始に時間が多くかかるこ
とです。コンパイル時の損失は長時間動作するプログラムでは無視できるもの
であり、より少なくなる関数呼び出しによる実行時の後押しは時間が経てば損
失を補うことができます。
POE::Component, POE::Driver and POE::Filter exist to document their
classes of objects. POE::Wheel contains some base functions for
tracking unique wheel IDs.
POE::Component、POE::Driver、POE::Filterは自身のオブジェクトのクラスを
ドキュメント化するために存在しています。POE::Wheelは一意的なホイールID
をトラッキングするための基本的な関数をいくつか含んでいます。
=back
=head1 SAMPLE PROGRAMS
This distribution contains several example and/or tutorial programs in
the ./samples directory. Be advised, however, that they are old and
may not exhibit the most current coding practices.
このディストリビューションはいくつかのサンプルやチュートリアルプログラ
ムを./samplesディレクトリ内に含んでいます。しかしながら、それらは古く、
現在のほとんどのコーディングの慣習を示していないかもしれないことに注意
してください。
The sample programs are scheduled for removal from this distribution
in version 0.1301. They are being moved to the web version of the POE
Cookbook, which is available at <http://poe.perl.org/?POE_Cookbook>.
サンプルプログラムはバージョン0.1301でこのディストリビューションから取
り除かれる予定です。それらはweb版のPOEクックブックに移動させられており、
http://poe.perl.org/?POE_Cookbook で入手可能です。
The author is always looking for new example ideas.
作者は常にサンプルスクリプトの新アイデアを探しています。
=head1 COMPATIBILITY ISSUES
POE has tested favorably on as many Perl versions as the author can
find or harass people into trying. This includes Linux, FreeBSD, OS/2
and at least one unspecified version of Windows. As far as anyone can
tell, nobody ever has tried it on any version of MacOS.
POEは作者が見つけるか人々に試すようにけしかけるかできる限りのバージョン
のPerlで順調にテストされました。これはLinux、FreeBSD、OS/2、少なくとも1
つの未特定のバージョンのWindowsを含みます。一般に知られている限りでは、
これまでにMacOSのいずれかのバージョンを試した人はいません。
POE has been tested with Perl versions as far back as 5.004_03 and as
recent as 5.7.2. The CPAN testers are a wonderful bunch of people who
have dedicated resources to running new modules on a variety of
platforms. The latest POE tests are visible at
<http://testers.cpan.org/search?request=dist&dist=POE>. Thanks,
people!
POEは古いものでは5.004_03から新しいものでは5.7.2までのバージョンのPerl
でテストされました。CPANテスターは各種プラットフォームで新しいモジュー
ルを動かすことに資源を捧げる素晴らしい人たちです。最新のPOEのテストは
http://testers.cpan.org/search?request=dist&dist=POE で見ることができま
す。皆さんに感謝します。
Please let the author know of breakage or success that hasn't been
covered already. Thanks!
まだ調査対象となっていない成功や故障について作者に知らせてください。あ
りがとうございます。
Specific issues:
特有の問題は以下の通りです。
=over 2
=item Various Unices
各種UNIX
No known problems.
知られている問題はありません。
=item OS/2
No known problems. POE has no OS/2 tester starting with version
0.1206.
知られている問題はありません。バージョン0.1206以降のOS/2テスターはいま
せん。
=item Windows
POE seems to work very nicely with Perl compiled for CygWin. If you
must use ActiveState Perl, please use build 631 or newer.
POEはCygWin用にコンパイルされたPerlではとてもよく動くようです。もし
ActiveState Perlを使用しなければならないなら、build 631以降を使用してく
ださい。
Currently there is nobody maintaining POE for Windows. Rocco will be
fixing things as he's able, but he has only limited access to Windows
machines for testing and development. If you would like to accelerate
POE's Windows support, please contact Rocco or the mailing list.
現在Windows用にPOEをメンテナンスしている者はいません。Roccoは可能な限り
修正を行いますが、彼がテストや開発のためにWindowsマシンを利用できるのは
限られたものでしかありません。もしPOEのWindowsサポートを加速させたいと
思うなら、Roccoかメーリングリストに連絡を取ってください。
Thanks to Sean Puckett, Douglas Couch, Hachi, and Dynweb for their
help in bringing POE's Windows support so far.
今までにPOEのWindowsサポートを手助けしてくれたSean Puckett、Douglas
Couch、Hachi、Dynwebに感謝します。
=item MacOS
POE 0.18 passes all tests on MacOS/X.
POE 0.18はMacOS/X上で全てのテストをパスしています。
Its pre-X support seems like a lost cause unless someone steps forward
to make it happen.
X以前のサポートは誰かがやろうと名乗り出ない限り見込みがなさそうです。
=back
=head1 SYSTEM REQUIREMENTS
POE requires Filter::Util::Call version 1.18 or newer. All the other
modules are optional.
POEはFilter::Util::Callのバージョン1.18以降を必要とします。他のモジュー
ルは全てオプショナルです。
Time::HiRes is recommended.
Time::HiResは推奨です。
Some of POE's sample programs use fork(). They won't work wherever
fork() isn't available; sorry.
POEのサンプルプログラムにはfork()を使用するものがあります。それらは
fork()が利用できないところでは動かないでしょう。申し訳ありません。
POE relies heavily on constants in the POSIX module. Some of the
constants aren't defined on some platforms. POE works around this as
best it can.
POEはPOSIXモジュールの定数に大きく頼っています。プラットフォームによっ
ては定義されない定数もあります。このことについてPOEは可能な限り上手く働
きます。
Some of POE's sample programs require a recent IO bundle, but you get
that for free with recent versions of Perl.
POEのサンプルプログラムには最近のIOバンドルを必要とするものがありますが、
それは最近のバージョンのPerlとともに無料で入手可能です。
If you want to use Filter::Reference to serialize data for
transporting over a network, you will need Storable, FreezeThaw, or
some other freezer/thawer package installed. If you want your data to
be shipped compressed, you will also need Compress::Zlib.
もしデータを直列化してネットワーク越しにデータを転送するために
Filter::Referenceを使用したい場合、Storable、FreezeThaw、または何らかの
他の冷凍/解凍用パッケージがインストールされている必要があります。もしデ
ータを圧縮して転送したい場合は、Compress::Zlibも必要になるでしょう。
B<Important Filter::Reference note:> If you're using Filter::Reference
to pass data to another machine, make sure every machine has the same
versions of the same libraries. Subtle differences, even in different
versions of modules like Storable, can cause mysterious errors when
data is reconstituted at the receiving end. When all else fails,
upgrade to the latest versions.
B<Filter::Referenceについての重要な注意:> もしFilter::Referenceを使用し
て他のマシンにデータを渡そうとしているなら、全てのマシンが同じライブラ
リの同じバージョンを持っていることを確認してください。Storableのような
モジュールのバージョンが異なるという状況でさえ、微妙な違いは受信側でデ
ータが再構成されるさいに謎めいたエラーを起こしかねません。もし何もかも
が失敗するなら、最新のバージョンにアップグレードしてください。
Filter::HTTPD uses a small world of modules including HTTP::Status;
HTTP::Request; HTTP::Date and URI::URL. The httpd.perl sample program
uses Filter::HTTPD, which uses all that other stuff. If you want to
write web servers, you'll need to install libwww-perl, which requires
libnet.
Filter::HTTPDはHTTP::Status、HTTP::Request、HTTP::Date、URI::URLを含む
小さな分野のモジュールを使用します。サンプルプログラムのhttpd.perlは
Filter::HTTPDを使用しますが、それら他のものも全て使用することになります。
もしwebサーバを書きたい場合はlibwww-perlをインストールする必要がありま
すが、それはlibnetを必要とします。
Wheel::Curses requires the Curses module, which in turn requires some
sort of curses library.
Wheel::CursesはCursesモジュールを必要としますが、それもまた何らかの
cursesのライブラリを必要とします。
=head1 SUPPORT RESOURCES
These are Internet resources where you may find more information about
POE.
これらはPOEについてより多くの情報を得られると思われるインターネット上の
リソースです。
=over 2
=item The POE Mailing List
POEメーリングリスト
POE has a mailing list at perl.org. You can receive subscription
information by sending e-mail:
POEのメーリングリストがperl.orgにあります。以下のEメールを送ると参加に
ついての情報を受け取ることができます。
To: poe-help@perl.org
Subject: (anything will do)
The message body is ignored.
To: poe-help@perl.org
Subject: (何でも構いません)
メッセージ本体は無視されます。
All forms of feedback are welcome.
どのような形でのフィードバックも歓迎します。
=item The POE Web Site
POEのWebサイト
POE has a web site where the latest development snapshot, along with
the Changes file and other stuff may be found: http://poe.perl.org/
POEには最新の開発スナップショットやChangesファイル、その他の様々なもの
があるwebサイトがあります。
http://poe.perl.org/
=item SourceForge
POE's development has moved to SourceForge as an experiment in project
management. You can reach POE's project summary page at
http://sourceforge.net/projects/poe/
POEの開発はプロジェクトマネージメントの実験としてSourceForgeに移動しま
した。POEのプロジェクトのサマリページが以下にあります。
http://sourceforge.net/projects/poe/
=back
=head1 SEE ALSO
This is a summary of POE's modules and the things documented in each.
これはPOEのモジュールと個別にドキュメント化されてる文書の要約です。
=head2 Events Layer
イベントレイヤ
These are POE's core modules.
これらはPOEの中心的なモジュールです。
=over 2
=item POE (this document)
POE (このドキュメント)
The POE manpage includes a sample program and walkthrough of its
parts, a summary of the modules which comprise this distribution,
POE's general system requirements, how to use POE (literally), and
where to get help. It also has a table of contents which you're even
now reading.
POEのmanページはサンプルプログラムを一つとその各部分の概観、このディス
トリビューションを構成するモジュールの要約、POEの一般的なシステム要件、
どのようにuse POEするか(文字通り)、どこで助けを得るかということを含んで
います。また、あなたがちょうど今読んでいる目録もあります。
=item POE::Kernel
The POE::Kernel manpage includes information about debugging traces
and assertions; FIFO events; filehandle watchers; Kernel data
accessors; posting events from traditional callbacks (postbacks);
redefining sessions' states; resource management; session aliases;
signal types, handlers, and pitfalls; signal watchers; synchronous
vs. asynchronous events; and timed events (alarms and delays).
POE::Kernelのmanページはデバッグ用のトレースとアサーション; FIFOイベン
ト; ファイルハンドルウォッチャ; Kernelデータアクセサ; 伝統的なコールバ
ック(ポストバック)からのイベントの通知; セッション状態の再定義、リソー
スマネージメント; セッションエイリアス; シグナルのタイプ、ハンドラ、落
とし穴; シグナルウォッチャ; 同期イベントvs非同期イベント; 指定時刻に動
作するイベント(アラームとディレイ)についての情報を含んでいます。
=item POE::NFA
The POE::NFA manpage covers this session's additional predefined
events, how NFA differs from Session, state changing methods, and the
spawn constructor.
POE::NFAのmanページはこのセッションの追加的なあらかじめ定義されているイ
ベント、NFAはSessionとどう違うのか、状態変更メソッド、spawn constructor
をカバーします。
=item POE::Session
The POE::Session manpage covers different kinds of states (inline
coderef, object methods, and package methods); postback mechanics;
predefined event names and the parameters included with them; resource
management and its effects on sessions; session constructors (new and
create); session data accessors; synchronous vs. asynchronous events
in more detail; why sessions don't stop by themselves, and how to
force them to.
POE::Sessionのmanページは各種の状態(inline codered、オブジェクトメソッ
ド、パッケージメソッド); ポストバック機構、あらかじめ定義されているイベ
ント名とそれらに含まれるパラメータ; リソースマネージメントとSessionに対
するその効果; セッションのコンストラクタ(newとcreate); セッションデータ
アクセサ; 同期イベントvs非同期イベントについての詳細; なぜセッションは
自分自身で止まらないのか、そして止まるように強制する方法をカバーします。
=back
=head2 I/O Layer
I/Oレイヤ
These modules comprise POE's default I/O abstraction.
これらのモジュールはPOEの標準のI/Oアブストラクションを構成します。
=over 2
=item POE::Driver
The POE::Driver manpage covers drivers in general and their common
interface.
POE::Driverのmanページはドライバを全般的にカバーし、またそれらの共通の
インターフェースを説明します。
=item POE::Driver::SysRW
The SysRW driver's manpage describes the sysread/syswrite abstraction
and covers parameters which can be used to customize a SysRW driver's
operation.
SysRWドライバのmanページはsysread/syswriteアブストラクションを説明し、
SysRWドライバの動作をカスタマイズするために使うことができるパラメータを
カバーします。
=item POE::Filter
The POE::Filter manpage covers filters in general and their common
interface. It discusses the pitfalls involved in switching filters
on a running wheel.
POE::Filterのmanページはフィルタを全般的にカバーし、またそれらの共通の
インターフェースを説明します。動作中のホイールでフィルタを交換するとき
に生じる落とし穴について論じます。
=item POE::Filter::Grep
Grep is part of the family of filters that includes Stackable, Map,
and RecordBlock. It applies a regexp filter on data passing through
it, before it reaches a Session. It's mainly used in filter stacks
(see POE::Filter::Stackable).
Grepは、Stackable、Map、RecordBlockを含むフィルタのファミリの一部です。
これはデータがSessionに届く前にGrepフィルタを通過するときに正規表現フィ
ルタを適用します。これは主にフィルタのスタックで使われます
(POE::Filter::Stackableを参照してください)。
=item POE::Filter::HTTPD
The HTTPD filter's manpage covers using POE as a web server.
HTTPDフィルタのmanページはPOEをwebサーバとして使うことをカバーします。
=item POE::Filter::Line
The Line filter's manpage discusses how to read and write data by
lines; how to change the newline literal or regular expression; and
how to enable newline autodetection when working with strange peers.
Lineフィルタのmanページは行単位でどのようにデータを読み書きするか; 改行
文字や正規表現を変更する方法; 見知らぬ相手と連携するときに改行の自動検
出をどのように有効にするかということを論じます。
=item POE::Filter::Map
Map is part of the family of filters that includes Stackable, Grep,
and RecordBlock. It transforms data passing through it, before it
reaches a Session.
Mapは、Stackable、Grep、RecordBlockを含むフィルタのファミリの一部です。
これはデータがSessionに届く前にMapフィルタを通過するときにデータを変換
します。
The Map filter is designed primarily to act as an interface between
filters that deal with different data formats, but it can be used
stand-alone to perform unique functions that no other filter does. In
this case it's something of a wildcard filter.
元々Mapフィルタは異なったデータフォーマットに対処するフィルタ間のインタ
ーフェースとして動くように設計されましたが、他のフィルタが行わない一意
的な機能を実行するために単独で使うことができます。その場合ちょっとした
ワイルドカードフィルタになります。
If you find yourself reusing the same custom Map filter, you may want
to turn it into a full-fledged filter.
もし同じカスタムMapフィルタを再使用していることに気が付いた場合、それを
独立した本格的なフィルタに変更したいと思うでしょう。
=item POE::Filter::RecordBlock
RecordBlock combines records into groups by count and flattens groups
of records back into a record stream. For example, RecordBlock might
combine log records into pairs.
RecordBlockはレコードをカウントしてグループに結合し、レコードのグループ
を平坦化してレコードのストリームに戻します。例えば、RecordBlockはログの
レコードを結合して対にすることができます。
=item POE::Filter::Reference
The Reference filter's manpage talks about marshalling data and
passing it between POE programs; and customizing the way data is
frozen, thawed and optionally compressed.
ReferenceフィルタのmanページはデータのマーシャリングとPOEプログラム間で
の転送; データが冷凍、解凍、オプショナルでの圧縮される方法のカスタマイ
ズについて説明します。
=item POE::Filter::Stackable
Stackable is a meta-filter designed to stack other filters. Stackable
manages the filters it contains and passes data between them. In
essence, the inner filters are combined into one super filter.
Stackableは他のフィルタをスタックするために設計されたメタフィルターです。
Stackableは収容しているフィルタを管理しデータをそれらの間で渡します。本
質的には、内部フィルタは一つのスーパーフィルタに合成されます。
The Map filter can also be used to perform quick and dirty functions
that aren't implemented in any single existing filter.
Mapフィルタは既存のフィルタ単体で実装されていない即席の汚い機能を実行す
るためにも使うことができます。
=item POE::Filter::Stream