You missed the key point - the anonymous subroutine is a closure because it "captures" the $type, $class and $self instances. So when you call the function later the $self variable is still accessible from inside $closure thus it all works.
In reply to Re: Re: Objects with Private Variables
by diotalevi
in thread Objects with Private Variables
by btrott
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |