in reply to Re: Using closures to achieve data hiding in OO Perl
in thread Using closures to achieve data hiding in OO Perl
That is a much better way to use closures. Rather than accessing the method through, $obj->{'key'}->(), it makes more sense to do it the way you've posted. Thanks. Interesting comment that one, about closures being hard to debug. In a big application, data hiding can come at a cost.
How often do you guys use closures? I mean, there are certain obvious places where closures can help like callbacks. I've never used closures. Never felt the need to. But citing from your experience, are there any other places where using closures is a good idea?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Using closures to achieve data hiding in OO Perl
by demerphq (Chancellor) on Jun 13, 2009 at 11:26 UTC | |
by saurabh.hirani (Beadle) on Jun 15, 2009 at 04:45 UTC | |
by demerphq (Chancellor) on Jun 15, 2009 at 12:39 UTC | |
Re^3: Using closures to achieve data hiding in OO Perl
by ikegami (Patriarch) on Jun 13, 2009 at 20:40 UTC |
In Section
Meditations