http://www.perlmonks.org?node_id=771019


in reply to Using closures to achieve data hiding in OO Perl

sub steal_ref { my $cleaneater = shift; my $gotself; local *{Dinnerclosure::washhands} = sub { $gotself = shift; }; $cleaneater->{'washhands'}->(); return $gotself; } my $gotself = steal_ref($cleaneater);

-r