Think about Loose Coupling | |
PerlMonks |
Inheritance without defining the object on inherited moduleby thanos1983 (Parson) |
on May 18, 2015 at 08:28 UTC ( [id://1126955]=perlquestion: print w/replies, xml ) | Need Help?? |
thanos1983 has asked for the wisdom of the Perl Monks concerning the following question: Dear Monks, I am new to the OO programming in general and also in Perl. I found this tutorials Object Oriented Programming in PERL that I am following and trying to understand how to use Inheritance. I have a created a similar code example from the tutorial, but I can not figure out how to call a method from another module without having to define the object inside the module. Sample of code to replicate my problem: mainl.pl
Person.pm
Employee.pm
The error that I am getting when I execute the code:
How can I call the method, without the need to define the object again! I assume there is a way since I am using inheritance. Thanks in advance for time and effort trying to answer my simple question.
Seeking for Perl wisdom...on the process of learning...not there...yet!
Back to
Seekers of Perl Wisdom
|
|