in reply to Re: goto and AUTOLOADed methods
in thread goto and AUTOLOADed methods

First argument should be object reference when you call object method:

sub AUTOLOAD { my $self = shift; my $method = $self->something_clever_returning_method_ref(); # or my $method = something_clever_returning_method_ref($self); # or whatever goto &$method($self); }

_ _ _ _ _ _
  M i c h a e l

Replies are listed 'Best First'.
Re: Re: Re: goto and AUTOLOADed methods
by fergal (Chaplain) on Aug 01, 2003 at 11:26 UTC
    But you haven't passed any of the other arguments now.

    The whole point of the magic goto &$sub is that you don't pass any arguments at all, the subroutine gets the current @_. It makes it look like the AUTOLOAD never happened, even if the method uses the caller() function to look at who called it, it won't see the AUTOLOAD routine, it will see the code that called the AUTOLOADer.