HogeA.pm
package HogeA;
use strict;
sub new {
my $class = shift;
my $self = bless {}, $class;
return $self;
}
sub hoge {
my $self = shift;
print "Hoge::hoge\n";
}
1;
HogeB.pm
package HogeB;
use strict;
use base qw(HogeA);
sub new {
my $class = shift;
my $self = bless {}, $class;
return $self;
}
sub hogehoge{
print "hogehoge\n";
}
1;
---sample.pl
use strict;
use HogeB;
my $b = HogeB->new();
$b->hoge;
ISAも使えます。
No comments:
Post a Comment