I'm not sure where to begin with inheritance though. I was hoping someone could point me in the right direction?A package in Perl can have a magic array @ISA. This array can hold strings, which must be names of packages (class and package is the same thing). When you call a method on an object, like $some_object->some_method() Perl checks which class (package) this $some_object belongs to (you specified it with function bless). If that class doesn't have some_method, then Perl checks the @ISA array of the class. It takes the first string from this array, assumes it's a package name and then searches that package for some_method. If some_method is found, Perl calls some_method, with $some_object as the first argument. So, $some_object->some_method() is equivalent to SomeClass::some_method($some_object) (SomeClass comes from an @ISA array). And that is OOP in Perl.
In reply to Re: Point me in the right direction with OO inheritance and static variables
by Anonymous Monk
in thread Point me in the right direction with OO inheritance and static variables
by Amblikai
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |