
naven8
Novice
Jul 5, 2012, 3:26 AM
Post #1 of 6
(874 views)
|
|
Need help in inheritance
|
Can't Post
|
|
Hi, I have 3 file in my program to check the inheritance.
--------------------------File.pl------------------ #!/home/utils/perl-5.8.8/bin/perl -w use B; use C; my $self= new C(); --------------------------C.pm------------------- package C; use B; our @ISA = qw(B); #use base 'B'; sub new { my $class = shift; print "$class @ISA\n"; my $self = $class->SUPER::new(); bless $self,$class ; return $self; } 1; ----------------------------B.pm------------------ package B; sub new { my $self =shift; my $hash = {}; bless $hash,$self; return $hash; } 1; The above code is giving following error. Can't locate object method "new" via package "C" at C.pm line 8. Can someone help me out here? Thanks
|