Hi Shawn! On Wed, 29 Mar 2017 08:09:12 -0400 Shawn H Corey <[email protected]> wrote:
> On Wed, 29 Mar 2017 09:25:06 +0800 > PYH <[email protected]> wrote: > > > sub my_recursion { > > my $self = shift; > > .... > > if (...) { > > $self->my_recursion; > > # you don't need $self. subroutine lookup starts > # in the same package. Just the sub by itself > # is good enough. > my_recursion(); > my_recursion accepts $self as its first argument, so you should pass it there. Doing «my_recursion($self);» is one option for doing that but : 1. It looks ugly. 2. It's less future proof. 3. It's a bad practice for OOP perl. The original code was fine. -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] http://learn.perl.org/
