sub AUTOLOAD { my $self = $_[0]; my $method = $self->something_clever_returning_method_ref(); # or my $method = something_clever_returning_method_ref($self); # or whatever goto &$method; }
Update: Change "shift" to $_[0].
Also add recommendation here: something_clever_returning_method_ref() should instantiate the method as a sub so that next time it gets called directly.
In reply to Re: goto and AUTOLOADed methods
by ctilmes
in thread goto and AUTOLOADed methods
by fergal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |