|Do you know where your variables are?|
Re: Simple inheritance questionby ikegami (Pope)
|on Apr 23, 2010 at 16:51 UTC||Need Help??|
Perl has no idea it's suppose to call test as a method.
The only difference between a function and a method is how the sub is called, or rather, how it expects to be called.
Non-virtual instance methods can be approximated using
I say "approximate", since it's doesn't check inheritance.
And there's also this syntax:
In this case, all of the following work:
Only the first really makes sense, though. And maybe the second one if you don't want test to be overridden by a child class of Two.