Of course, you'll probably need to modify that and add some (different|better|more appropriate) error testing for invalid method calls.sub AUTOLOAD { my $self = shift; our $AUTOLOAD; # I usually do... #$AUTOLOAD =~ s/(?:\w+::)+//; # ... but here's your pattern $AUTOLOAD =~ s/.*://; if ($self->{xmms}->can($AUTOLOAD)) { $self->{xmms}->$AUTOLOAD; } else { die "$AUTOLOAD not a valid method!"; } }
In reply to Re: AUTOLOAD question
by The Mad Hatter
in thread AUTOLOAD question
by forrest
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |