问题:无法访问父对象属性
Verification.pm:(父类)
package Verification;
use Verification::Proid;
sub Proid
{
my $self = shift;
print Dumper($self);
my $result = Verification::Proid->validate($self);
return $result;
}
自卸车结果
$VAR1 = bless( {
'event_name' => 'validate',
'Verification_Type' => 'Proid',
'Verification_Value' => 'ecmetric',
'xml_request' => bless( do{\(my $o = 148410616)}, 'XML::LibXML::Document' ),
'Verification_Options' => [
{
'2' => 'UNIX'
}
],
'Verification_ID' => '3'
}, 'Verification' );
Proid.pm: (儿童班)
package Verification::Proid;
our @ISA = qw(Verification);
sub validate
{
my $self = shift;
print Dumper($self);
my $result;
foreach my $validation_type ( @$self->{Verification_Options} )
{
do stuff...
}
}
自卸车结果
$VAR1 = 'Verification::Proid';
子类没有正确获取传递给它的对象的所有属性,我做错了什么?
谢谢!