On Fri, Dec 15, 2000 at 11:23:23PM -0800, Ian Hickson wrote:
Having said that: The only feature that I really miss from Perl 5 is the
lack of method pointers -- that is, references to functions in a package
with an associated object.
Oh, that's easy. Use a closure...
my $foo = Foo-new;
my
Michael G Schwern wrote:
package Class::MethRef;
use strict;
sub meth_ref {
my($proto, $method, @args) = @_;
return sub { $proto-$method(@args) };
}
So this...
my $meth_ref = $obj-meth_ref('foo', @some_stuff);
$meth_ref-();
is equivalent to this..