in reply to AUTOLOAD question
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!"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: AUTOLOAD question
by ysth (Canon) on Nov 30, 2003 at 01:50 UTC |