in reply to Re^3: Using perlclass 'methods'
in thread Using perlclass 'methods'
Simple things first: It is not the message Undefined subroutine &main: +:ratio because we are not in package main but in a class Gear where t +he method is defined.
I assumed that if it does not find ratio() as a method in class then it goes to main looks there. Given that a method always requires its object (e.g. $self->ratio()) then I thought the reasonable thing would be to assume that this is a sub in main. Fair enough. (also I missed the experimental bit, so we shall see). Edit: Oh but it does not know that the object is not preceeding the method, it asusmes that the object is there, that's why it looks further ahead in the multiplicative factors.
|
---|