lib/Parent.pm
package Parent;
use warnings;
use strict;
sub import {
use Module::Pluggable search_path => $_[0].'::Component', sub_name => 'components';
}
sub new {
my ( $self, $opts ) = @_;
my $c = bless { option => $opts }, $self;
$c->{component}->{"$_"} = $_ for $c->components;
$c;
}
1;
lib/Child.pm
package Child;
use warnings;
use strict;
use base 'Parent';
1;
hoge.pl
use lib qw(./lib);
use Child;
my $child = Child->new;
で、hoge.plを実行。
$ perl hoge.pl
Use of uninitialized value in concatenation (.) or string at ./lib/Parent.pm line 6.
なぜだ。。。orz
0 件のコメント:
コメントを投稿