in reply to Help understanding perltooc examples?
Yes, it does create those methods. Each of those subroutines is a closure over $datum, so each one knows exactly what $datum it is dealing with.
As for the shift->classobj(), that shift is affecting the @_ that came into the subroutine. So, if you were to say:
where foo is some legal datum, what happens it the anonymous sub's @_ is populated with $self. That is shift'ed, then the _classobj() method is called on it and assigned to $self within the anonymous subroutine.my $x = $self->foo();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Help understanding perltooc examples?
by injunjoel (Priest) on Feb 19, 2005 at 22:58 UTC |