You're just missing the assignment to $self in greet():
This should then work as you expect.sub greet { my($self, $grt) = @_; return sub { my($subject)= @_; print "$grt $subject \n"; }; }
Cheers,
Tim
In reply to Re: How to implement closures in Package
by tfrayner
in thread How to implement closures in Package
by perlCrazy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |