in reply to Re: AUTOLOAD question
in thread AUTOLOAD question

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