in reply to How to implement closures in Package
Hi,
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 Section
Seekers of Perl Wisdom