Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Using closures to achieve data hiding in OO Perl

by tantarbobus (Hermit)
on Jun 12, 2009 at 16:37 UTC ( #771019=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://771019]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2019-10-22 04:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?