use vars '$AUTOLOAD'; sub AUTOLOAD { my ($self) = @_; my ($method); ($method = $AUTOLOAD) =~ s/.*://; if ($self->{xmms}->can($method)) { $self->{xmms}->$method; } else { # whatever } } #### { no strict 'refs'; for my $method (qw/is_paused is_playing play pause stop/) { *$method = sub { $_[0]->{xmms}->$method }; } }