in reply to Re^2: Missing object reference in sub
in thread Missing object reference in sub

I tried looking at the module source myself ...

In case you don't mind modifying the sources... this is what a quick grep turned up (in RPC2.pm / sub serve {...}):

my $eval = eval { $result = &{ $methods->{$method} }(@{ $call->{'v +alue'} }) }; if ($@) { ... }

Presuming that the $self available within that serve method is what you need (not sure... but why not try?), you could add it to the argument list yourself, i.e.

my $eval = eval { $result = &{ $methods->{$method} }($self, @{ $ca +ll->{'value'} }) }; ^^^^^

Just an idea... (untested)

Replies are listed 'Best First'.
Re^4: Missing object reference in sub
by Lazarus (Novice) on Sep 28, 2007 at 14:04 UTC

    I didn't think that this would work but I gave it a shot anyway. As I suspected by looking at the RPC2.pm, the object there is not based on the IO::Socket class, so while I can now get a $self, it isn't one that I can use. Nice try though. Thanks.