in reply to coderef to an object method
you're doing essentially the same thing as:data => \&gotodata,
(they aren't the same thing, exactly, but they're functionally equivalent for your purposes, one is a named referrence and the other is an anonomous referrence to essentially the same thing). I bother to point that out because then it's easier to see the transition to what you should be doing for method calls, which is this:data => sub { gotodata(@_) },
That is: creating an anonomous subroutine reference for a closure around the method call.data => sub { $self->gotodata(@_) },
------------ :Wq Not an editor command: Wq
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: coderef to an object method
by rinceWind (Monsignor) on Jul 21, 2004 at 09:48 UTC |