=encoding euc-jp =head1 NAME =begin original parent - Establish an ISA relationship with base classes at compile time =end original parent - コンパイル時に基底クラスとの ISA 関係を構築する =head1 SYNOPSIS package Baz; use parent qw(Foo Bar); =head1 DESCRIPTION =begin original Allows you to both load one or more modules, while setting up inheritance from those modules at the same time. Mostly similar in effect to =end original 複数のモジュールを読み込んで、それらのモジュールからの継承を同時に 設定します。 事実上ほとんど以下と同じです package Baz; BEGIN { require Foo; require Bar; push @ISA, qw(Foo Bar); } =begin original By default, every base class needs to live in a file of its own. If you want to have a subclass and its parent class in the same file, you can tell C not to load any modules by using the C<-norequire> switch: =end original デフォルトでは、それぞれの基底クラスはそれぞれ独自のファイルにある 必要があります。 サブクラスと親クラスを同じファイルに置きたい場合は、C<-norequire> オプションを使って C にモジュールを読み込まないように伝えることが できます: package Foo; sub exclaim { "I CAN HAS PERL" } package DoesNotLoadFooBar; use parent -norequire, 'Foo', 'Bar'; # will not go looking for Foo.pm or Bar.pm =begin original This is equivalent to the following code: =end original これは以下のコードと等価です: package Foo; sub exclaim { "I CAN HAS PERL" } package DoesNotLoadFooBar; push @DoesNotLoadFooBar::ISA, 'Foo'; =begin original This is also helpful for the case where a package lives within a differently named file: =end original これはまた、パッケージが異なった名前のファイルにある時にも有用です: package MyHash; use Tie::Hash; use parent -norequire, 'Tie::StdHash'; =begin original This is equivalent to the following code: =end original これは以下のコードと等価です: package MyHash; require Tie::Hash; push @ISA, 'Tie::StdHash'; =begin original If you want to load a subclass from a file that C would not consider an eligible filename (that is, it does not end in either C<.pm> or C<.pmc>), use the following code: =end original C が適格なファイル名と扱わない (つまり、C<.pm> や C<.pmc> で 終わっていない) ファイルからサブクラスをロードしたいときは、以下のコードを 使います: package MySecondPlugin; require './plugins/custom.plugin'; # contains Plugin::Custom use parent -norequire, 'Plugin::Custom'; =head1 DIAGNOSTICS =over 4 =item Class 'Foo' tried to inherit from itself =begin original Attempting to inherit from yourself generates a warning. =end original 自分自身を継承しようとすると警告が生成されます。 use Foo; use parent 'Foo'; =back =head1 HISTORY =begin original This module was forked from L to remove the cruft that had accumulated in it. =end original このモジュールは、積み重なった良くないものを取り除くために L からフォークしました。 =head1 CAVEATS =head1 SEE ALSO L =head1 AUTHORS AND CONTRIBUTORS RafaEl Garcia-Suarez, Bart Lateur, Max Maischein, Anno Siegel, Michael Schwern =head1 MAINTAINER Max Maischein C< corion@cpan.org > Copyright (c) 2007 Max Maischein C<< >> Based on the idea of C, which was introduced with Perl 5.004_04. =head1 LICENSE This module is released under the same terms as Perl itself. =begin meta Translate: SHIRAKATA Kentaro Status: completed =end meta =cut