in reply to Re: AUTOLOAD question
in thread AUTOLOAD question
or create a stub in your module, so each method only goes through AUTOLOAD the first time it is called:&{$self->{xmms}->can($AUTOLOAD) || die "no $AUTOLOAD method"}($self->{ +xmms});
(Untested, but should give you the idea.)if (my $methodref = $self->{xmms}->can($AUTOLOAD)) { { no strict 'refs'; *$AUTOLOAD = sub { unshift @_, shift()->{xmms}; goto &$methodref + }; } $methodref->($self->{xmms}); }
|
|---|