I have a class that has a new method and uses this object to call method X. When I call X from the object, the first parameter value is $ self, and the rest are the values ββthat I sent. Now, when I call the same method from another method on an object, the first value is no longer $ self and its just the values ββsent internally. How can I solve this situation?
Example:
my $p = TEST->new; $p->mymethod(1,2,3);
but if in 'mymethod' is called by another method:
sub anothermethod{ my ($self, $a) = @_; mymethod(1,2,3);
How to write "mymethod" so that it handles both situations? Or am I fundamentally doing something wrong?
perl
Kyle rogers
source share