Well, first of all... when you do
data => \&gotodata,
you're doing essentially the same thing as:
data => sub { 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 { $self->gotodata(@_) },
That is: creating an anonomous subroutine reference for a closure around the method call.
------------
:Wq
Not an editor command: Wq