It would be cool to be able to call this new method in my program via the base class
That's what subclassing does: you can call any method from the base-class, and if the subclass implements or overrides that method, the subclass's method will be called.
package Base; sub method1 { my $self = shift; $self->method2(); } sub method2 { print "Base\n"; } package Sub; @ISA = qw(Base); sub method2 { print "Sub\n"; } package main; Base->method1; Sub->method1; __END__ Base Sub
In reply to Re^3: has-a in Perl
by Joost
in thread has-a in Perl
by skazat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |